tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Wingfield <>
Subject Re: Rewriting URLs in Tomcat
Date Thu, 29 Jul 2004 10:26:18 GMT
sendRedirect(...) tells the browser to use a resource in a different 
location. That location can be same webapp, different webapp, different 

forward(...) is for the same server only.
In context:
Out of context:

For forwarding to a different context you have to have the relevant 
permissions or the servletContext.getContext(foreignContextName) call 
will return null. In tomcat the context doing the forwarding has to be 
marked as crossContext:


PS the chained invocations above are illustrative only, not as I would 
normally code it ;)

Jacob Weber wrote:

> Tim Funk <> wrote:
>>At I have a project called ServletUtils.
>>You can use either RedirectFilter or ForwardFilter. They both can use regex's.
> "Robert Harper" <> wrote:
>>Have you tried the HttpServletResponse .sendRedirect( String url ) method?
> Correct me if I'm wrong, but I think both of these approaches would 
> require the URL I'm requesting to be part of the same application as the 
> one I'm redirecting to. So, for example, I couldn't redirect from:
> to
> Or am I missing something? This is what I'm trying to do.
> Thanks,
> Jacob
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message