tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Ruthenbeck <just...@nextengine.com>
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.

justin

At 12:12 PM 1/8/2003, you wrote:
>I would like to have a url structure of the form:
>
>     myplace.com/user/xxx/resource/yyy
>
>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 
>authentication,
>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
>/user/xxx/resource/yyy?
>
>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
>Tomcat.
>
>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.
justinr@nextengine.com
Confidential -
    See http://www.nextengine.com/confidentiality.php
____________________________________


--
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