servlet service的描述:

链接:https://www.nowcoder.com/questionTerminal/3f368578e43d48b1968d79b935d00972
来源:牛客网

1.     service方法是在servlet生命周期中的服务期,默认在HttpServlet类中实现,根据HTTP请求方法(GET、POST等),将请求分发到doGet、doPost等方法实现。

2.1   GenericServlet
抽象类给出了设计servlet的一些骨架,定义了servlet生命周期还有一些得到名字、配置、初始化参数的方法,其设计的是和应用层协议无关的。

2.2   doget/dopost与Http协议有关,是在
javax.servlet.http.HttpServlet 中实现的。

3.    doGet和doPost方法在HttpServlet类中实现,GenericServlet中实现了service()

4.    常说所有的请求都先由service方法处理,而javax.servlet.GenericServlet接口实现了javax.servlet.Servlet接口,且javax.servlet.http.HttpServlet
是 javax.servlet.GenericServlet 的子类。只有最先定义好了的service方法才可以处理所有的请求。

时间: 2024-08-26 22:57:31

servlet service的描述:的相关文章

Servlet.service() for Servlet jsp threw exception javax.servlet.ServletException:File "/pageFoo

1.错误描述 Servlet.service() for Servlet jsp threw exception javax.servlet.ServletException:File "/pageFoot.jsp "not found 2.错误原因 <jsp:include page="../../pageFoot.jsp"></jsp:include> 3.解决办法 利用<jsp:include></jsp:includ

严重: Servlet.service() for servlet [spring] in context with path [/XX] threw exception [Request

一.描述:最近在使用springmvc+spring+hibernate4.0进行整合开发时出现了 严重: Servlet.service() for servlet [spring] in context with path [/XX] threw exception [Request processing failed; nested exception is org.hibernate.HibernateException: No Session found for current thr

Servlet service for Servlet jsp threw exception javax serv

1.错误描述 Servlet.service() for Servlet jsp threw exception javax.servlet.ServletException:File "/pageFoot.jsp "not found 2.错误原因 <jsp:include page="../../pageFoot.jsp"></jsp:include> 3.解决办法 利用<jsp:include></jsp:includ

Spring Cloud ZooKeeper集成Feign的坑2,服务调用了一次后第二次调用就变成了500,错误:Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception [Request processing failed; nested exception is com.n

错误如下: 2017-09-19 15:05:24.659 INFO 9986 --- [ main] s.c.a.AnnotationConfigApplicationContext : Refreshing org.spring[email protected]56528192: startup date [Tue Sep 19 15:05:24 CST 2017]; root of context hierarchy 2017-09-19 15:05:24.858 INFO 9986 --

tomcat异常之Servlet.service() for servlet [spring-mvc] in context with path

严重: Servlet.service() for servlet [spring-mvc] in context with path [/helloworld-springmvc] threw exception [Handler processing failed; nested exception is java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config] with root cause java.lang.

Servlet.service() for servlet UserServlet threw exception java.lang.NullPointerException 空指针异常

错误付现: 严重: Servlet.service() for servlet UserServlet threw exceptionjava.lang.NullPointerException at com.liuyang.servlet.UserServlet.doGet(UserServlet.java:17) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.Http

报错!!!Servlet.service() for servlet [action] in context with path [/myssh] threw exception [java.lang.NullPointerException] with root cause java.lang.NullPointerException

这个为什么报错啊~~ at com.hsp.basic.BasicService.executeQuery(BasicService.java:33) 这个对应的语句是   Query query =this.sessionFactory.getCurrentSession().createQuery(hql); Sep 24, 2017 11:39:50 PM org.apache.catalina.core.StandardWrapperValve invoke 严重: Servlet.se

Servlet.service() for servlet jsp threw exception

报错信息如下: 七月 17, 2017 4:02:10 下午 org.apache.catalina.core.ApplicationDispatcher invoke 严重: Servlet.service() for servlet jsp threw exception     at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)     at org.apache.catalina.

严重: Servlet.service() for servlet [jsp] threw exception java.lang.NullPointerException

五月 04, 2018 11:53:24 上午 org.apache.catalina.core.ApplicationDispatcher invoke 严重: Servlet.service() for servlet [jsp] threw exception java.lang.NullPointerException at org.apache.jsp.tag.web.partyRoleId_tag.doTag(partyRoleId_tag.java:125) at org.apac