Ivo Silva wrote:
Hello, there!

I'm trying to implement a filter that takes a given request URL (that
contains a dummy folder) like so:

http://localhost/context/dummy_folder/page1.jsp

This filter takes the dummy_folder part from the URL (just like a URL
Rewrite), creates a custom RequestWrapper (HttpServletRequestWrapper)
with the correct paths (URI, URL, Servlet Path...) and passes it to
the filter chain.

By "correct path" I mean: http://localhost/context/page1.jsp

Every thing works great except when the target page (page1.jsp) does a
forward request:

RequestDispatcher rd = request.getRequestDispatcher("page2.jsp");
rd.forward(request, response);

This leads the requests to an infinite loop that keeps coming back to page1.jsp.

I don't know if this is the correct approach (using an
HttpServletRequestWrapper to override the original request values).
The request forwarding uses the original request instead of my wrapper.

Any directions would be appreciated.

Why redo what has been done before ?
Check : http://www.tuckey.org/urlrewrite/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to