tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike Bremford" <>
Subject RE: Using mod_rewrite with Tomcat
Date Wed, 27 Sep 2000 16:24:46 GMT
(Note - IANATD (I am not a Tomcat Developer :-).

The trouble with using RequestDispatcher.Include as it is that you can't set
any headers - well, nothing useful anyway.

The trouble with duplicating and modifying it so that you can, is that at
the end of the day the URI may not map to a real file. Consider mapping
/bar/foo.jsp to /baz.jsp. Which context should we use? /bar or /ROOT. What
about the pathInfo? When you don't map a URI to a file, deciding how to chop
it up into ContextPath, ServletPath and PathInfo is completely arbitrary.

However, doing it the other way round would work - i.e. returning the
rewritten URI from the getRequestURI(), getServletPath() and friends, and
storing the originally requested URI in an attribute. As luck would have it
I sent in a patch for just this a few weeks ago but it seems to have
disappeared in the maelstrom. It's in the archives at
html, although it's got lots of annoying "=0A"'s at the end of each line.

Costin et al - forgive the cross-post, and I'm sorry to bring this up AGAIN,
but what did you decide on this? Is something like this going into 3.2
final? I'm trying to document it but I'm not sure what to write!

Cheers... Mike

> -----Original Message-----
> From: Daniel Barclay []
> Sent: 27 September 2000 16:51
> To: Mike Bremford
> Cc:; Mike Bremford
> Subject: Re: Using mod_rewrite with Tomcat
> Mike Bremford wrote:
> >
> > >From the servlet spec v2.2 section 5.4:
> >
> > "requestURI = contextPath + servletPath + pathInfo"
> >
> > So you can't request /nicepath and have it map to
> /ugly/path.jsp without
> > changing the requestURI to "/ugly/path.jsp". While this is OK, it's
> > different to the behaviour of mod_rewrite for CGI's and for
> Apache/JServ
> > (where ReqeustURI was the original URI and ServletPath was
> the actual path).
> Can you apply or borrow any of the behavior of
> Requestdispatcher.include,
> where the original request URI is available through the
> ServletRequest
> methods, and the included servlet's URI is available through standard
> attributes (javax.servlet.include.request_uri, etc.) of the request?
> Daniel
> --
> Daniel Barclay
> Digital Focus

View raw message