Whats the difference between a servlet session and a servlet context?
A servlet session is a very different thing from a servlet context. An HttpSession is a mechanism used to simulate and maintain a continuous user session between a Web browser and Web application, largely managed by the servlet container. The HTTP protocol is stateless, it is essentially a request-response scheme, so servlet sessions are maintained by passing a unique HTTP cookie value for each request, or by dynamically including an identifier in servlet URLs, known as URL-rewriting. A ServletContext object represents the overall configuration of the servlet container and has several methods to get configuration parameters, exchange data amongst servlets, forward requests and load resources. The servlet context is usually obtained indirectly through the ServletConfig object, passed to a servlet’s init(ServletConfig) method, or from the servlet getServletConfig() method. Actions: Follow-up, clarify or correct this answer. Submit a new question.