What are the JSP expression languages

Source: Internet
Author: User
Tags function definition keyword list range tld

①el keyword List

Div-except (/) mod-fetch (%) eq-equals (= =) ne-Not equal to (!=)
Lt-Less than (<) GT-greater Than (>) le-less than or equal to (<=) GE-greater than or equal to (>=)
And-Logical with (&&) or-Logical OR (| |)         Not-logical non (!) True-Logical true
False-logical false null-null value instanceof-empty-NULL test operator


②el built-in objects

----------------------------------------------------
Suppressed objects                 type                        Description
-------------------------------------------- --------
pagecontext         java.util.map     The PageContext object that represents this JSP
pagescope           Java.util.Map      get the value of the property name for the page share range
requestscope        java.util.map     gets the value of the property name for the request shared range
sessionscope         java.util.map     Gets the value of the property name for the session shared range
applicationscope    java.util.map     gets the value of the property name for the application shared range
param                java.util.map     function with Request.getparameter () method
paramvalue          java.util.map     Feature with Request.getparametervalues () method
header               java.util.map     function with Request.getheader () method
heradervalues        java.util.map     function with Request.getheaders () method
cookie               java.util.map     Feature with Request.getcookies () method
initparam           The java.util.map     function is the same as the Application.getinitparameter () method
---------------------------------- ------------------------


③el operator

[] .
()
- ! Empty
* / %
+ -
< > <= >=
== !=
&&
||
${A? B:C}


Custom Functions in ④el

1. Write function definition, function declaration must be static in class
Package elfunction;
public class Functions {
public static string ToUpper (string value) {
return Value.touppercase ();
}
}

2. Write the custom function of the TLD file, placed in the <taglib> tag
<function>
<name>toUpper</name>
<function-class>elfunction.functions</function-class>
<function-signature>
Java.lang.String ToUpper (java.lang.String)
</function-signature>
<description>a to Upper function.</description>
</function>

3. Introduction of label definition files in Web.xml
<taglib>
<taglib-uri>/WEB-INF/tlds/elfunction.tld</taglib-uri>
<taglib-location>/WEB-INF/tlds/elfunction.tld</taglib-location>
</taglib>

4. Introduce custom functions in the form of a custom label
   <%@ taglib uri= "/web-inf/tlds/elfunction.tld" prefix= "Elfun"%>
   ${elfun:toupper ("ABCDEFG")}

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.