GetParameter and GetAttribute in the Java EE and El Expressions ${requestscope} and ${param[]}

Source: Internet
Author: User


GetParameter

① gets all of the string types. such as xy in http://name.jsp?name=xy

② get parameter values passed by Post/get

③ used for client redirection, such as clicking a link or submitting a button, is used to receive data when using a form or URL redirection value


GetAttribute

① Gets the type is Object

② is used for server end multiplicity orientation, that is, the Getter/setter property in Sevlet using the forward function or struts. GetAttribute can only receive the value of the program with SetAttribute.

③session.getattribute () to get session


El expression

Using the expression language, you can get the request parameter values directly, get the specified property values for JavaBean in the page, get the request headers, and get the page,request,session and application.

El expression has 11 built-in objects

PageContext
Pagescope
Requestscope
Sessionscope
Applicationscope
Param
Paramvalues
Header
Headervalues
Initparam
Cookies

In the request domain, such as through Request.setattribute ("name", "XY"), in the page can be ${requestscope.name}

such as Xy.jsp?name=xy, will be through ${param["name"} Get

GetParameter and GetAttribute in the Java EE and El Expressions ${requestscope} and ${param[]}

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.