JSTL获取FORWARD_REQUEST_URI(使用表达式语言)

时间:2013-12-16 15:05:52

标签: jsp jstl

我有一个页面

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}" />

1 个答案:

答案 0 :(得分:0)

<c:set var="myString" value="${requestScope['javax.servlet.forward.request_uri']}"/>
相关问题