JSP Scope Communication Object __java_web

Source: Internet
Author: User
1, scope implicit objects-built-in map implementation, setattribute, GetAttribute,

1, pagescope page scope pagecontext– stored content can only be valid within the current page scope

2, Requestscope request scope request– can only be valid within the same request, pay attention to a Web page click Refresh is a new request

3. The Sessionscope session scope (used to store all information about a user's session) session– and browser-related scopes, and a browser corresponds to a conversation. The browser does not close is a sessions, even if you open multiple tabs, is also a session. The Web page will timeout without doing anything. The following are configured in Web.xml:

<!--Configure Timeout management for the session, in minutes. A negative configuration is permanently valid-->
  <session-config>
    <session-timeout>30</session-timeout>
  </ Session-config>

4, Applicationscope Application scope application– and application-related, equivalent to global static values. As long as the application does not restart, it is always available.

Example:

Session.setattribute ("username", "John");
String name = Session.getattribute ("username");
2. Web program development process
1, Database
2, based on database tables to generate related data access DAO and related entity class Bean
3, create related pages according to business
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.