Monday 9 February 2015

How do servlets work? Instantiation, session variables and multithreading

please read the comment from stackoverflow:-

When the servletcontainer (like Apache Tomcat) starts up, it will deploy and load all webapplications. When a webapplication get loaded, the servletcontainer will create the ServletContext once and keep in server's memory. The webapp's web.xml will be parsed and every ServletFilter and Listener found in web.xml or annotated with respectively @WebServlet@WebFilter and @WebListener will be created once and kept in server's memory as well. When the servletcontainer shuts down, it will unload all webapplications and the ServletContext and all ServletFilter and Listener instances will be trashed.
http://stackoverflow.com/questions/3106452/how-do-servlets-work-instantiation-session-variables-and-multithreading/3106909#3106909

-------------------------------------------------------
http://stackoverflow.com/questions/2183974/difference-between-each-instance-of-servlet-and-each-thread-of-servlet-in-servle/2184147#2184147

http://www.javaworld.com/article/2072798/java-web-development/write-thread-safe-servlets.html

No comments:

Post a Comment