Request < Session < application
Each corresponding interface
The interface that corresponds to the request object:
Javax.servlet.ServletRequest its sub-interface:javax.servlet.http.HttpServletRequest
Interface for session object:javax.servlet.http.HttpSession
Interface for application objects:javax.servlet.ServletContext
SetAttribute (string name, Object o), getattribute (string name);
1.Request
Call the above two methods, only on a single request (forwarding not count the request, because the forwarding is the server-side behavior) in effect, when the information returned to the client, the object is destroyed
2.Session
Concept:
to track customer status, when a user visits a site, the server will generate a SessionID for the customer and return it to the client as a cookie, and when the customer goes to another service on the site, the current sessionid makes a request, identifies which user,