I’m using Google AppEngine with Java. I would like to be able to redirect users that go to something like:
mydomain.com/<their screen name>
to a servlet that can show their profile.
I’m not sure that there is an url-pattern I could use in my web.xml file that would map correctly without interfering with the stuff I do want mapped to other places (like .jsp files, etc.)
I could do this with a custom 404 redirect, but that doesn’t seem like the best option.
Is there a better way to map a mydomain.com/screenName type pattern to a custom servlet?
Wouldn’t it be better to map the user screen names to a sub-path, for example:
Then in your
web.xml:UserServletin this example could take care of doing whatever it is you need to with each user’s screen name. This also helps because it won’t interfere with your current mappings.