JAVA Web four properties for a range rollup

Source: Internet
Author: User

First, you need to know the client jumps and server differences:

Client Jump: Response.sendredict (String Path), the address bar has changed.

The request property cannot be passed.

Server side jump:<jsp:forward> Address bar does not change. Can pass the request property.

Request attribute scope: Only after the server side jumps, the contents of all settings will be stopped.

Session Property Scope: Whether it is a client jump or server-side jump, only if it is a property set can be obtained.


1:page: (PageContext)

Save properties on only one page. Invalid after jump.

Indicates that a property is set on this page and is not valid after a jump.

After jumping through <jsp:forward>server (the address bar does not change ). property cannot be obtained!



2:request:

After the server jump (<jsp:forward>) is valid;

The properties set by the request via hyperlink (<a href= "" ></a>) are not available;

The Request property is used more in MVC design mode.



watermark/2/text/ahr0cdovl2jsb2cuy3nkbi5uzxqvc2hpewvxawfuz2xkaa==/font/5a6l5l2t/fontsize/400/fill/i0jbqkfcma== /dissolve/70/gravity/southeast ">

3:session:

In another session, no matter what jumps can be used, but the new browser can not be used;

To be able to make any other page related to the Settings page;

Properties can also be obtained in hyperlinks (hyperlink address bar changes, which belong to the client jump).

Each new browser connects to the server and is a new session. So the new browser is unable to get the session properties.




4:application:

Save on the entire server, all users can use;

Regardless of how many new browser application properties are available, once the server is started again, the previously set properties will all disappear.


Copyright notice: This article blog original articles, blogs, without consent, may not be reproduced.

JAVA Web four properties for a range rollup

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.