Servlet
Java编程之道
这个作者很懒,什么都没留下…
展开
-
Servlet的生命周期
1.启动服务器并加载web.xml文件2.客服端向服务器发出请求3.初始化服务器4.service根据客户端请求方式的不同调用doGet()或doPost()方法5.doGet()或doPost()执行具体操作并对客户端做出响应6.调用destory()释放资源并关闭servlet。...原创 2018-03-26 13:53:28 · 122 阅读 · 0 评论 -
解决XML中报“cvc-complex-type.2.4.a: Invalid content was found starting with element ”错误
解决方案:在xml的头web-app中xmlns:xsi属性添加“http://www.springmodules.org/schema/cache/springmodules-cache.xsd http://www.springmodules.org/schema/cache/springmodules-ehcache.xsd” 如图:...转载 2018-03-26 15:05:29 · 1170 阅读 · 0 评论 -
Servlet知识总结
一.Servlet生命周期的三个阶段 1.init():初始化仅执行一次,主要负责加载Servlet时初始化Servlet对象 2.service():核心方法一般httpServert中会有get,post两种处理方式,再调用doGet,doPost方法时会构造HttpServletRequest和HttpServertResponse请求和响应两个对象作为参数 3.destory():在...原创 2019-02-16 15:57:49 · 146 阅读 · 0 评论 -
Servlet HTTP Status 405 - HTTP method GET is not supported by this URL
是因为重写doPost或doGet方法时 super.doPost(req, resp); super.doGet(req, resp); 去掉这2句话就可以了转载 2019-05-05 21:29:38 · 3045 阅读 · 0 评论