Nine implicit objects of [Android] JSP

Source: Internet
Author: User

PageContext object:

1. You can get references to other eight implicit objects as a portal object

1.1 getexception acquires exception hidden Object

1.2 GetPage Get page object

1.3 getrequest get request Object

1.4 GetResponse Get response Object

1.5 getservletconfig get config object

1.6 Getservletcontext Get application Object

1.7 getsession Get session Object

1.8 getout Get out object

2. domain object, the entry of four scopes, you can manipulate domain properties in four scopes

Scope: Current JSP page

Action period: Created at the beginning of page access and destroyed at the end

Four scopes:

ServletContext (Application)

Session (session)

Reqquest (Request)

PageContext

If a data is used only on the current JSP page, you can use the pagecontext domain

If a data is used in addition to the current Servlet and is used in Request forwarding, use the requesting domain

If a data, except now I want to use, after a while I have to use, there is session Domain

If a data, in addition to my own with other people to use, exists in the servlecontext domain

3.jsp Mapping

<servlet>

<servlet-name>index</servlet-name>

<jsp-file>/index.jsp</jsp-file>

</servlet>

<servlet-mapping>

<servlet-name>index</servlet-name>

<url-pattern>/jsp/*</url-pattern>

</servlet-mapping>

The Servlet responds to the request to produce the data, and the JSP is presented by forwarding technology , and the display of the data JSP

The Servlet is the controller, andtheJSP is the template engine

Nine implicit objects of [Android] JSP

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.