java - How to get the original request url from a servlet/jsp after multiple servlet forwards -
I'm working on the Cruise Booking app using strokes / tiles which multiple Uses the servlet / jsp to display the right jsp for further performance. But, once you are used to present the page, after reaching the final JSP, call For example Then, when I call on How can you get the original (client created) request URL from JSP that has reached through multiple forward I got the following post on stack overflow Used to indicate that solution, but they do not know how to find the original request URL after a number of requests. You can use a filter to request the attribute to the original address and then jsp JSP: this works That's because the filter has set the request sender by default. This means that the filter only executes for direct client requests, for which forwarding is not included / $ {pageContext.request.requestURL} in the JSP it Returns the path of JSP
$ {pageContext.request.requestURL} / bookmark / showcruiseDetails.jsp me / booking / ShowCruiseDetails.jsp
request.setAttribute ("original", request.getRequestURL ());
$ {pageContext.request.attribute ["origin"]}
Comments
Post a Comment