JSP Study Notes (EL)

Source: Internet
Author: User

1. How to access implicit object through El
El can be used in two locations:
A. template text
B. attribute settings for standard and custom tags

Implicit object
Related to the value range: applicationscope, sessionscope, requestscope, pagescope
Related to input and output: Param, paramvalues
Header and headervalues
Related to cookies: cookies
It is related to the initial parameter of servletcontext: initparam
There is also a pagecontext

2. El access Operators
Property operation symbol:. or []
Operator symbol of the set: []
If the attribute to be accessed contains non-letters, you must use []

3. Other El operation symbols
A. arithmetic: +,-(Binary), *,/(DIV), % (MOD)
B. Logic: & (and), | (OR ),! (Not)
C. Relational: = (EQ ),! = (NE), <(LT),> (GT), <= (LE),> = (GE)
D. Empty: used to determine whether it is null or empty
E. Conditional :?

4. El Functions
A. How to Use El Functions
$ {Prefix: functionname (args0 ,...)}
B. How to define a function
The function must be defined as a public static method, and the class access modifier is also public
Package william m;
Public class myfunction {
Public static Boolean equals (string str1, string str2 ){
Return str1.equals (str2 );
}
}
C. Configure Descriptor
<Function>
<Name> equals </Name>
<Function-class> William M. myfunction </function-class>
<Function-signature> Boolean equals (Java. Lang. String, java. Lang. String) </function-signature>
</Function>

 

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.