tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Ruthenbeck <>
Subject Re: Servlet Mapping Strategy w/ user-specific URLs
Date Wed, 08 Jan 2003 20:40:11 GMT

There's no way to accomplish what you're shooting for using only the 
mappings in the web.xml.  However, you could pretty easily do it through a 
filter running on requests to "/user/*".  If you do this, you could forward 
any requests that match URI "/user" to your UserServlet and anything that 
matches "/user/*/resource/*" to your ResourceServlet by parsing the URI 
String in your own code.

Hope that helps ... let me know if it's not clear.


At 12:12 PM 1/8/2003, you wrote:
>I would like to have a url structure of the form:
>where "user" and "resource"
>are handled by individual servlets.  I would like users to have the 
>ability to POST
>there username/password to /user and have it respond with their personal
>url, e.g.:
>     /user/some-user
>A "UserServlet" would be responsible to setting up the appropriate 
>so that they could GET/POST (assuming proper authentication) to
>     /user/some-user/resource
>Is it possible to setup a servlet mapping such that a UserServlet handles
>requests to /user/xxx, but a ResourceServlet handles requests to
>I can't think of how to do this and am currently planning on using mod_rewrite
>to rewrite the urls as appropriate since I have Apache 2 sitting in front of
>Is there perhaps a better way of handling this that I haven't 
>considered?  That
>is, perhaps taking advantage of some aspect of Apache itself that I 
>haven't thought of?
>Any help in this regard would be greatly appreciated.
>- Jeff

Justin Ruthenbeck
Software Engineer, NextEngine Inc.
Confidential -

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

View raw message