JSP-implicit object-pagecontext

Source: Internet
Author: User

The pagecontext object provides methods to access other hidden objects.

In the pagecontext object, you can use the following two methods to save and obtain attributes:

Setattribute (string name, object value)

Getattribute (string name)

Attributes saved in the pagecontext object can only be obtained on the current page. That is, the pagecontext object has a page range.

Papgecontext object. You can also set and obtain attributes saved in other range objects. Use the following two methods:

Setattribute (string name, object value, object value, int scope)

Getattribute (string name, int scope)

Scope can be pagecontext. page_scope/request_scope/session_scope...

In pagecontext, you can use the following two methods to delete attributes in a range:

Removeattribute (string name, int scope)

Removeattribute (string name) // delete all attributes with names in the specified range

Page also provides the following methods to search for attributes:

Object findattribute (string name) // searches for the attribute of the specified name in the order of page, request, session, and application. If the attribute is found, the value of the attribute is returned. If not, null is returned.

From the method provided by the pagecontext object, we can see that the pagecontext object actually provides a unified entrance to access other hidden objects. In most cases, you can directly use the pagecontext object to complete the desired function.

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.