tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mike W-M" <m...@ward-murphy.co.uk>
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.)

Mike.

----- Original Message -----
From: "RXZ JLo" <rufoo2001@yahoo.com>
To: "Tomcat Users List" <tomcat-user@jakarta.apache.org>
Sent: Friday, December 06, 2002 9:50 AM
Subject: RE: static url routing



--- "Noel J. Bergman" <noel@devtech.com> 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
>

Thanks
rf

To unsubscribe, e-mail:
<mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail:
<mailto:tomcat-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:tomcat-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-user-help@jakarta.apache.org>


Mime
View raw message