jstl 或者el表达式如何读取request中的对象

字体大小: 中小 标准 ->行高大小: 标准

1. 我在一个超连接后加个参数如:
http://localhost:8080/test/testjstl.jsp?pid=001

此时在jsp页面中,获取jsp传过来的pid的参数值要使用 ${param.pid}

2. 如果是在java代码中 ,使用了request.setAttribute("attr","attrValue");

那么在jsp中获取request中的参数值就要使用下面的代码
${requestScope.attr} 或者${attr}

3. 在<c:if></c:if test="....">表达式的test属性 中获取 session或request中的属性时,要使用empty或not empty
<c:if test="${not empty USER_INFO}">
<iframe src="${pageContext.request.contextPath}/myservice/NgCallServiceInfo.do" name="iframe" frameborder="0" width="728" height="276" class=""></iframe>
</c:if>

此文章由 http://www.ositren.com 收集整理 ,地址为: http://www.ositren.com/htmls/68894.html