tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike W-M" <>
Subject Re: static url routing
Date Fri, 06 Dec 2002 10:17:17 GMT
I assume you've looked through all the elements available to you in web.xml.
(I can't think of any that might help, but I'm no authority!)
One (reasonably simple) solution would be to write yourself a servlet that
performs the mapping for you.  Assuming the root of the path remains
constant for your requests like this, map that to the servlet.
The servlet then has to examine the final part of the URL, lookup against
your mapping-list (which you should really load up from an XML file during
class-load, but you *could* hard code it), and then either redirect or
forward to your required resource.   (Redirect involves an extra round-trip
and will mean that the user sees a URL that ends with the real filename;
forwarding will leave the "original" URL in place.)


----- Original Message -----
From: "RXZ JLo" <>
To: "Tomcat Users List" <>
Sent: Friday, December 06, 2002 9:50 AM
Subject: RE: static url routing

--- "Noel J. Bergman" <> wrote:
> > my html files have long names like
> > a_b_c_d_xyz213_e_f_g.html,
> a_b_c_d_pqr983_e_f_g.html
> > is it possible to have urls like
> > http://localhost:8080/myapp/html/xyz213
> > point to the first file above?
> You can use either a Filter, or mod_rewrite in
> Apache httpd.

I had a glance at javax.servlet.Filter - with this I
cannot avoid entering a servlet, which will then wont
be 'static' response.

> --- Noel


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

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

View raw message