JSP built-in object -- out & pagecontext

Source: Internet
Author: User

(1) Out object

An out object represents a page output stream, which is usually used to output variable values and Constants on the page. Generally, the out object can be used in the output expression to achieve the same effect.

In servlet: printwriter out = response. getwriter ()

Out. println ();

The output expression can be used to replace all the places where the out clause is used, and the output expression is more concise. The essence of the expression is out. write (·······)

(2) pagecontext object

Indicates the page context. This object is mainly used to access Shared data between JSP. You can use pagecontext to access the variables in the range of page, request, session, and application.

Getattribute (string name): Get the attribute within the page range.

Getattribute (string name, int scope) gets the name attribute within the specified range. scope can be the following four values:

Pagecontext. page_scope corresponds to page range 1

Pagecontext. request_scope corresponds to request range 2

Pagecontext. session_scope corresponds to session range 3

Pagecontext. application_scope corresponds to application range 4

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.