This is a Java servlet filter (as per Servlet API 2.3). This filter lets you keep in the request scope all the attributes from the original HTTP request: javax.servlet.forward.request_uri, javax.servlet.forward.context_path, javax.servlet.forward.servlet_path javax.servlet.forward.path_info, javax.servlet.forward.query_string. So JSP page will be always aware about the original request regardless of the forwarding chain.
How to use it:
a) download originalrequestflt.jar and save it in WEB-INF/lib
b) describe this filter in web.xml.
c) describe a mapping for this filter in web.xml. E.g.:
in this example filter will be on for the each .jsp file. So in your JSP page you can use for example request.getAttribute("javax.servlet.forward.query_string") for getting an original query string.
For downloading:
Original request package: originalrequestflt.jar
See also JSOS - the largest collection of servlets and filters.