EL表达式页面传值(${param}和requestScope)
来源:互联网 发布:九域神皇免费阅读 软件 编辑:程序博客网 时间:2024/05/17 04:38
1.对于浏览器地址栏中的地址拼接参数
http://localhost:8888/Test/index.jsp?test=123
- EL表达式获取
<body> ${param.test}</body>
- Java脚本获取
<body> <%=request.getParameter("test") %></body>
2.向request作用域赋值
<% request.setAttribute("test", "123"); %>
//java 获取方式 <body> <%request.getAttribute("test"); %> </body>//requestScope方式 <body> ${requestScope.test}//EL获取方式 <body> ${test} </body>
${param.name} 等价于 request.getParamterValues(“name”),{param[name]}
这两种方法一般用于服务器从页面或者客户端获取的内容。
${requestScope.name} 等价于 request.getAttribute(“name”)
等价于${ name}
一般是从服务器传递结果到页面,在页面中取出服务器保存的值。
可以传到客户端也可以传到服务器里面
要得到属性的话可以这样${scope.attribute}其中scope指 pageSocpe、requestScope、sessionScope、applicationScope,attribute 指的就是你在某个scope中设置的属性了
阅读全文
1 0
- EL表达式页面传值(${param}和requestScope)
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 10029---关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别
- 关于EL表达式中requestScope和param区别,el表达式与jstl标签
- 关于EL表达式中requestScope和param区别,el表达式与jstl标签
- J2EE中getParameter与getAttribute以及EL表达式${requestScope}和${param[]}
- J2EE中getParameter与getAttribute以及EL表达式${requestScope}和${param[]}
- python使用vps重新拨号之后出现连接mongoDB超时的处理
- Xshell设置和使用
- Java annotation 入门
- 担保相关知识
- java冒泡排序
- EL表达式页面传值(${param}和requestScope)
- Spark架构与作业执行流程简介
- (转)详解 awk 工具的使用方法
- myeclipse创建maven项目相关问题及解决
- 第 10 章 触发程序
- png图片压缩https://tinypng.com/
- 分布式利器Zookeeper(一)
- HDFS块文件和存放目录的关系
- 如何将自己的项目上传到GitHub中的仓库之中