我有一個頁面,是JSTL得到FORWARD_REQUEST_URI(表達式語言)
mypage/whatever.jsp
但其實我是想顯示在瀏覽器的網址:
foo/bar/index.jsp
我可以用得到它:
<%= request.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI) %>
但我需要將它設置爲一個變量使用jstl。
我嘗試:
<c:set var="topic" value="${request.getAttribute(RequestDispatcher.FORWARD_REQUEST_URI)}" />
<c:out value="${topic}" />
你在哪裏使用RequestDispatcher.forward。 – Loc
我在我的.jsp頁面上使用它... – redconservatory