El Expression-3

Source: Internet
Author: User

2. Implied objects related to the input

There are two hidden objects associated with the input:param and paramvalues, which are the more specific hidden objects in El.

For example, when we want to get the user's request parameters, we can take advantage of the following methods:

Request.getparameter (string name)
 request.getparametervalues (string name)

In El, you can use both Param and paramvalues to get the data.

${param.name}

${paramvalues.name}

3. Other hidden Objects

Cookies

JSTL does not provide a cookie-setting action,

Example: To get a value in a cookie that has a setting name of Usercountry, you can use ${cookie.usercountry} to get it.

headers and headervalues

The header stores the data that the user's browser and server use to communicate

Example: To get the version of the user's browser, you can use ${header["User-agent"}.

In some cases, it is possible to have different values for the same header name, and you must instead use Headervalues to obtain these values.

Initparam

Initparam get environment parameters for setting Web site (context)

Example: General method string Userid= (String) application.getinitparameter ("userid");

You can use ${initparam.userid} to get the name UserID

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.