Hi,
If you don't want to use a filter you should consider the urlrewrite
capacity of apache.
Here is a tech note that should help you
http://www.amitysolutions.com.au/documents/URLRewriting-technote.pdf
Of course if u use tomcat as a stand alone server it could be not adapted.
Though It's not very clear for me that u prevent "bad thing to happen"
with apache mod_rewrite, because you're still responsible for the
interpretation of the url.
Cheers.
Jason Novotny a écrit :
Hi,
I'm developing a web application and have a couple important
constraints:
+ URLs should look "nice" and be bookmarkable in the style of REST
e.g. http://localhost/myapp/mylayout/someaction/
+ Should be relatively easy to move the WAR call it myapp.war to some
other WAR e.g. someappp.war so that is accessible as
http://localhost/someapp/ with as little configuration changes as
possible in web.xml and elsewhere
The approach I started to take was to use a servlet filter that
could take any request e.g. "myapp?foo=bar&color=red" and by using
request.getPathInfo() do a forward to the servlet "myapp" with the
additional params tacked on. This seemed to be a good strategy since
the forward hides the additional params so in the browser you see only
the "/myapp/mylayout/someaction/" as desired.
However, I noticed depending on the initial URL a user put in,
sometimes bad or unexpected things happened so I thought maybe using a
filter with a forward is very fragile code.
Has anyone else done this kind of thing-- I tried looking at some
popular frameworks but they didn't seem to offer much...
Thanks very much, Jason
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]