Servlet is very powerful server side scripting language. It is a class which basically handle network request-response model. It is very powerful as we had earlier like CGI.
Basic Request-Rsponse Model
When browser send http request to java web server(like Tomcat, Jeety) then server pass the request to specific servlet , which process the request and perform task and revert response to the browser.
Where Servlet Runs ?
Servlet runs under web server. We can say that servlet container . Example-
1.Tomcat
2.Jeety
Servlet Life Cycle
Servlet follows certain life cycle which is managed by servlet container. Servlet life cycle is as -
Servlet Initialization -By calling the init () method.
Process Request - calls service() method to process a client's request.
Servlet Termination -The servlet is terminated by calling the destroy() method.
Finally, servlet is garbage collected by the garbage collector of the JVM.
0 Comment(s)