What are the built-in objects for JSP? What is the difference? What are the ways to separate?

Source: Internet
Author: User

JSP has the following 9 built-in objects:

Request : represents the HttpServletRequest object, client requests. It contains information about browser requests and provides several useful methods for obtaining cookies, headers, and session data.

Response: represents the HttpServletResponse object and provides several methods for setting the response to the browser (such as cookies, headers, etc.), and the Web page returns to the client's response

Out : An object is an instance of Javax.jsp.JspWriter and provides several methods that you can use to echo the output to the browser.

PageContext: represents a Javax.servlet.jsp.PageContext object. This object provides access to all objects and namespaces within a JSP page (that is, the four scope spaces, such as page space, request space, session space, application space), which means that he can access the information stored in the current request corresponding session. You can also take a property value for the current application's application, which is equivalent to a synthesizer of all the features in the page, wrapping the common servlet-related functionality.

Session : represents a Javax.servlet.http.HttpSession object for a request. Session can store user's state information

Applicaton: represents a Javax.servle.ServletContext object. A system-like global variable that enables resource sharing in Web applications.

Config: represents a Javax.servlet.ServletConfig object. Used to store the initial data after the JSP has been compiled.

Page : represents a servlet instance generated from the page, and the JSP page itself

Exception: for error pages, no exceptions are caught. Represents the exception and error message that is generated when the JSP page runs, which is only available in the Error page (page directive, which is set to Iserrorpage to true).

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.