Servlet-mapping in web.xml to exclude files

B

Barney Barumba

Hi,

I'm trying to map all files which DO NOT match a certain pattern to my
servlet, and leave the matching files to the default
Tomcat/BEA/whomever implementation. For example, send all
*.gif,*.jpg,*.html files to the implementation servlet, and all others
to my servlet.

This seems to be a fairly simple thing, but I can't see any way of
doing it given the Java Servlet Spec 2.3 (or 2.4 for that matter, but
I'm not using that).

It seems to me I need one of two things: either the ability to negate
a url-pattern, or the ability to positively match urls and forward
them to the default servlet (not a servlet that matches '/*', but the
implementation servlet which handles all requests which are not
matched by any servlet-mapping).

Does anybiody have any idea how I can achieve this?

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

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top