How can a servlet discover all mappings in the same context?

M

msenin

I have a rewritten URL like
http://myhost.com/servlet/MyServlet/param1/value1/param2/param3

I have a servlet that needs to decode this URL into regular URL, i.e.
servlet name plus query string, e.g.
http://myhost.com/servlet/MyServlet?param1=value1&param2&param3

So I thought I can traverse the ovewritten URL right to left
substituting everything after each '/' and ask the web server whether
the remaining string represents a valid resource URI. This way I can
tell resource URI from query string.

Is there a way to ask server whether a URI will map into an existing
resource?

Is there a way to better overwrite URLs so that there's no '?' in it? I
ultimately try to make dynamic URLs look like static - to make them
search-engine-friendly.

Thanks!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,231
Members
46,820
Latest member
GilbertoA5

Latest Threads

Top