Remy,

On 1/9/13 10:04 AM, Remy Maucherat wrote:
> Hi,
> 
> I ported a valve providing mod_rewrite functionality (most of it) for
> Tomcat "8", and committed it in the sandbox. This could be easily placed
> in the main repository, where it would provide an additional item in the
> "new features" department for this major release.
> 
> I have a documentation page for it that could be included. The basics is
> that it uses a rewrite.properties that has the same contents as the
> configuration for mod_rewrite. The rewrite.properties is placed in the
> host config folder if the valve is declared in a Host, or in WEB-INF in
> the webapp if declared in a Context.
> 
> The main differences with mod_rewrite are:
> - (the big one) no proxy flag
> - no SSL attributes
> - less file related flags available
> - allows virtual host rewriting using a host flag (it replaces the host
> header instead of the URL and maps again)
> Point 2 and 3 are probably relatively easy to fix, while obviously a
> proxy is a more involving endeavor.
> 
> There are rewrite solutions out there already, but this one does not use
> complex tricks (because it can simply start over request processing
> instead of doing more complex request dispatching, which also impacts
> the Servlet state), and is mod_rewrite compatible.
> 
> Comments ? Is it nice or useless ?

I haven't looked at the code but my first reaction was "why not use
url-rewrite?" When you say that it can re-start request processing, you
mean that you can essentially perform internal rewrites/forwards/etc.
without having to use the request dispatcher? Certainly reducing stack
size is not a bad idea and should improve performance.

The fact that it is mostly compatible with mod_rewrite configuration
syntax is definitely a plus, though url-rewrite 4 can read
mod_rewrite-style configuration files, too.

Finally, there is the spec-versus-implementation issue. It's great that
Tomcat could provide this kind of capability, but since it is
out-of-spec we might be doing a disservice to our users. I know I'm
always irritated when someone posts to the users' list that they are
switching from JBoss/Sun/Jetty/Whatever and Tomcat doesn't mirror some
out-of-spec capability and they are all mad about it. That's what I like
about url-rewrite: you make it a part of your webapp and it should work
everywhere.

In general, I'm -0 on the idea mostly given the existence of a
well-supported alternate tool (url-rewrite) and the risks of vendor
lock-in (even when the vendor is the ASF ;).

-chris

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to