Servlet
Life cycle of servlet:
1)Load servlet class into memory (load once, after
request from web container. It is loaded with help
of class loader in JVM)
2)Create instance of servlet.
3)Initialize servlet using init(). (this method is called
once on first request of web container)
4)Calling of service() method for processing. (this
method is called several times, revices request and
then forwarded to the server from client machine)
5)Calling of destroy().(instance and memory block is
released along with all the resources allocated to
the client, once the client closes the web page.)
Ways to create a servlet
1)myservlet implements servlet
2)myservlet Implements generic servlet
3)myservlet Implements http servlet