Request,session,application, three comparisons

Source: Internet
Author: User

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,

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.