Nine built-in objects in JSP

Source: Internet
Author: User

JSP contains nine objects of that type. These nine built-in objects are examples of servletapi classes or interfaces,

Only JSP specifications initialize them by default, that is, they are already objects and can be used directly.

 

1. Application: an instance of javax. servlet. servletcontext.

 

2. config: the instance of javax. servlet. servletconfig. This instance represents the configuration information of JSP.

 

3. Exception: Java. Lang. throwable instance, which indicates exceptions and errors on other pages. This object can be used only when the iserrorpage of the compilation command page is true.

 

4. Out: javax. servlet. jsp. jspwriter instance. This instance represents the output stream of JSP and is used to generate HTML for the output content.

 

5. Page: indicates the page itself, which is usually of little use, that is, this in servlet. Its type is the generated servlet.

 

6. pagecontext: the instance of javax. servlet. jsp. pagecontext. This object indicates the JSP page context. You can use this method to access the shared data on the page.

 

7. Request: For an instance of javax. servlet. http. httpservletrequest, client request parameters are encapsulated in this object.

 

8. Response: javax. servlet. http. httpservletresponse instance. The response from the server to the client. This object is rarely used for direct response,

The output response uses the out object, while the response is often used for redirection. Common methods include:

 

9. sendredirect (Java. Lang. String localtion)

 

10. Session: the instance of javax. servlet. http. httpsession. This object represents a session

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.