1. EL Expressions Overview
El (express lanuage) expression can be embedded inside the JSP page, reduce the writing of JSP script, El appears to replace the JSP page script writing.
2. El extracts data from the domain (El's most important role)
JSP script: <%=request.getattribute (name)%>
El expression replaces the above script: ${requestscope.name}
El's main function is to obtain data in four fields, format ${el expression}
El gets the value in the PageContext domain: ${pagescope.key};
El obtains the value in the request domain: ${requestscope.key};
El gets the value in the session field: ${sessionscope.key};
El gets the value in the application domain: ${applicationscope.key};
El obtains a value from four domains ${key};
---also gets the properties from the PageContext domain, the request domain, the session field, the application domain, and gets it in a domain, not looking backwards.
3. El's Built-in objects 11 X
Pagescope,requestscope,sessionscope,applicationscope
----Get data from a domain in a JSP
param,paramvalues--receive parameters.
Equivalent to Request.getparameter () request.getparametervalues ()
header,headervalues--Getting request header information
Equivalent to Request.getheader (name)
initparam--getting global initialization parameters
Equivalent to This.getservletcontext (). Getinitparameter (name)
Cookie--web Cookies in development
Equivalent to Request.getcookies ()---cookie.getname ()---cookie.getvalue ()
Pagecontext--web in the development of PageContext.
PageContext get the other eight big objects
${pagecontext.request.contextpath}
equivalent <%=pagecontext.getrequest () .getcontextpath%> This code cannot be implemented get the name of your web App
4. El execution expression
For example:
${1+1}
${empty User}--empty Determines if an object is NULL, is NULL returns True
${user==null?true:false}
El and Jstl Learning (i) El Technology