WebContainer
Tomcat Jar
J2EE specifications
servlet-api.jar
Implementation
catalina.jar
Inheritance hierarchy Request Object
ServletRequest(Interface)
HttpServletRequest(Interface)
HttpServletRequestWrapper(Class)
Similarly, for Response Object, i.e., replace Request with Response.
How web Container calls service method?
Web container interacts with
public service(rq, rs)
which internally calls theprotected service(rq,rs)
of the HttpServlet class.
Servlet - JDBC Integration
Layers involved :
Note: JDBC Jar can be placed either in <WEB-INF>/lib
folder in IDE created project structure OR <tomcat>/lib
folder under tomcat installation folder.
ServletException
Defines a general exception a servlet can throw when it encounters difficulty.
During Initialization by init() style method always throw Serlvet Exception to let Web Container know some Exception(anamoly) has occured.
Similarly, in destroy() style method always catch
checked exception
and convert it intounchecked Exception
to let the web container know that some exception occured during destruction of Web Servlet.
Last updated