Tomcat 4.1: how to limit url-pattern to a single directory

M

Marc Twain

Hi -

Simple problem, but I can't seem to find a solution:


I have an application in www.mysite.com/myapp, and a controller that
is using a url-pattern of *.do. My users can go and type
www.mysite.com/myapp/whatever.do and it works.

BUT (and that's the problem) they call also type in
www.mysite.com/myapp/doesntexits/no/stillno/whatever.do
.... and the URL mapping still kicks in! - meaning all my relative
links to images, etc. are broken.


Is there a way to limit the mapping to a single directory,
non-programmitically? I tried /*.do but that didn't work either. I
would rather do things withough having to parse the path_name because
CGI variables differs between webservers.

TIA!!!

AJ
 
S

Sudsy

Marc said:
Hi -

Simple problem, but I can't seem to find a solution:


I have an application in www.mysite.com/myapp, and a controller that
is using a url-pattern of *.do. My users can go and type
www.mysite.com/myapp/whatever.do and it works.

BUT (and that's the problem) they call also type in
www.mysite.com/myapp/doesntexits/no/stillno/whatever.do
... and the URL mapping still kicks in! - meaning all my relative
links to images, etc. are broken.

I just tried this out on Tomcat 4.1 and, as I had hoped/expected,
received a '400 - Invalid path' response. Without seeing the files,
I would guess that you have some funky configuration which is
internally redirecting when an access error occurs.
An extract from your logs would be most edifying...
 

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

No members online now.

Forum statistics

Threads
474,436
Messages
2,571,696
Members
48,796
Latest member
Greg L.
Top