How to get include url in Filter
In my JSP page index.jsp
I have
<c:import url="/hello.jsp?name=user" />
I have a filter which is mapped to hello.jsp
, how do I get the include url in this case /hello.jsp?na开发者_如何学运维me=user
. If I try request.getUrl(), it gives me /index.jsp
.
You can fetch it using getQueryString()
It's been sent as a request parameter. Just use ServletRequest#getParameter()
to get it.
String name = request.getParameter("name"); // "user"
// ...
精彩评论