JSP中EL隐含对象

JSP中EL隐含对象
EL隐含对象有以下11种:
1.pageContext:取得用户请求或页面信息;
2.pageScope:相当于page.getAttribute(name);
3.requestScope:相当于request.getAttribute(name);
4.sessionScope:相当于session.getAttribute(name);
5.applicationScope:相当于application.getAttribute(name);
6.param:相当于request.getParameter(name);
7.paramValues:相当于request.getParameterValues(name);
8.header:相当于request.getHeader(name);
9.headerValues:相当于request.getHeaders(name);
10.cookie:相当于request.getCookies();
11.initParam:相当于config.getInitParameter(name);

testELform.jsp:
view plaincopy to clipboardprint?
1. <%@ page language="java" contentType="text/html; charset=UTF-8"
2. pageEncoding="UTF-8"%>
3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4. <html>
5. <head>
6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7. <title>Login</title>
8. </head>
9. <body>
10. <form action="testELshow.jsp" method="post">
11. Name:<input name="name" type="text" /><br />
12. Sex:
13. <input name="sex" type="radio" value="male" />male
14. <input name="sex" type="radio" value="female" />female
15. <br />
16. Like:
17. <input name="like" type="checkbox" value="sing"/>sing
18. <input name="like" type="checkbox" value="dance"/>dance
19. <br />
20. <input type="submit" value="Submit" />
21. </form>
22. </body>
23. </html>


testELshow.jsp:
view plaincopy to clipboardprint?
1. <%@ page language="java" contentType="text/html; charset=UTF-8"
2. pageEncoding="UTF-8"%>
3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
4. <html>
5. <head>
6. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
7. <title>Login</title>
8. </head>
9. <body>
10. Name:${param.name }
11. <br />
12. Sex:${param.sex }
13. <br />
14. Like:${paramValues.like[0] }
15. ${paramValues.like[1] }
16. <br />
17. </body>
18. </html>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值