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

来源:互联网 发布:高跟鞋推荐 知乎 编辑:程序博客网 时间:2024/06/08 04:49
  1. 我在一个超连接后加个参数如:
    http://localhost:8080/test/testjstl.jsp?pid=001

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

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

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

    1. 在表达式的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>