EL(Expression Language)
the purpose of el is to aid producing scriptless jsp pages
syntax of el in a jsp page:${expr}
you can escape the expression:
\${expr}
<body>
<form action="el2.">
username:<input type="text" name="username">
password:<input type="submit" name="password">
<input type="submit" value="submit" >
</form>
<body>
${param.username }
${param.password}
<!-- <%= request.getparameter("username") %>-->
</body>
beans within the namespace avaiable to the jsp can be accessed easily using el.
beans can be accessed by way of dot notation:${bean.attribute}
beans can be located by searching through the scopes:page,request,session and application
beans scope can be specified by preceding the bean name with the scope
${sessionscope.cust.fristname}
<%session.setattribute("aa","bb"); %>
${sessionscope.aa}<br>
<%=session.getattribute("aa") %>
implicit object :description
if the bean return an array ,and element can specify its
index using[] nation:
${paramvalues.fruit[2]}
username: <input type="text" name="username">
<input type="text" name="username">
<input type="text" name="username">
${paramvalue.username[2]}
example operation
${2+1*3}
user user = new user;
session.setattribute("user",user);
${sessionscope.user.sex}
user user = (user)session.getattribute("user");
string sex = user.getsex();
${sessionscope.user.sex}equals${sessionscope.user["sex"]}
typecast:${param.count+20}
推荐阅读
-
EL表达式及其11个使用对象(及jsp中的对象)实例介绍
-
C#条件拼接Expression<Func<T, bool>>的使用
-
解决使用elementUI框架el-upload跨域上传时session丢失问题
-
jsp JavaBean el表达式
-
[Err] 1055 - Expression #1 of ORDER BY clause is not in GROUP BY clause 的问题 MySQL
-
[BZOJ1385] [Baltic2000] Division expression
-
哪些苹果设备可以升级os x el capitan系统
-
如何升级OS X 10.1?OS X 10.11 El Capitan安装图文教程
-
Python使用正则表达式(Regular Expression)超详细
-
Web基础了解版07-EL表达式