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>


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM