Kristian you can write a servlet filter for this. It will be easier that way. mod_rewrite is one way of doing it , but if you are going to target only your JSP I would recommend to go to the servlet filter way. You could also use valves, but you can do almost the same things with servlet filter.
Example of class is: public final class URLRewriteFilter implements Filter { // you have to implement this method public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { // you code goes here chain.doFilter(request, response); } } If you need help implementing it, just let me know. With Best Regards Bruno Georges Glencore International AG Tel. +41 41 709 3204 Fax +41 41 709 3000 |---------+---------------------------> | | Kristian Rink | | | <[EMAIL PROTECTED]| | | 428.net> | | | | | | 15.12.05 11:37 | | | Please respond | | | to "Tomcat Users| | | List" | | | | |---------+---------------------------> >--------------------------------------------------------------------------------------------------------------------------------------------------| | | | To: Tomcat Users List <users@tomcat.apache.org> | | cc: | | Subject: URL rewiting best practise? | | | |Distribute: | |Personal? |-------| | | | [ ] x | | | |-------| | | | >--------------------------------------------------------------------------------------------------------------------------------------------------| Hi all; currently I'm into deploying a small jsp/servlet based application which more or less utilizes a dispatcher servlet to provide .jsp-based content. For that, I'm into using URLs like http://foobar:8080/Site?path=home/users to, in example, show the site section "home -> users". For now, I'd like to do URL rewriting in order to provide users with an URL like http://foobar:8080/home/users or maybe http://foobar:8080/Site/home/users to see the same content. My initial idea was to use apache, mod_jk and mod_rewrite to do right this, but don't feel too good about that idea because sooner or later the site URL will also have to carry around a session ID and in that I am afraid that URL rewriting will get me into trouble. So, my question: What is the best way of doing URL rewriting in such a situation? Does tomcat provide any ways of achieving what I want? TIA and bye, Kris -- Kristian Rink * http://zimmer428.net * jab: [EMAIL PROTECTED] icq: 48874445 * fon: ++49 176 2447 2771 "Be yourself the kind of change you want to see in this world." (Gandhi) --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] LEGAL DISCLAIMER. The contents of this e-mail and any attachments are strictly confidential and they may not be used or disclosed by someone who is not a named recipient. If you have received this email in error please notify the sender by replying to this email inserting the word "misdirected" as the message and delete this e-mail from your system. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]