jQuery in Action, 3rd edition
The moose likes Servlets and the fly likes filter mapping to specific JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "filter mapping to specific JSP" Watch "filter mapping to specific JSP" New topic

filter mapping to specific JSP

Tom Henricksen
Ranch Hand

Joined: Mar 23, 2004
Posts: 136

We can map to a specific servlet:

And we can do all JSPs:
But when I try to map to
This doesn't work in Tomcat 5.0.30 I get
SEVERE: Parse error in application web.xml
java.lang.IllegalArgumentException: Invalid <url-pattern> index.jsp in filter mapping
I looked at the 2.3 servlet spec and don't see anything about this. I am thinking this isn't possible? I am not sure why.

[ August 09, 2007: Message edited by: Ben Souther ]
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Have you tried:




Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Sundaram Karthick

Joined: Jun 26, 2007
Posts: 24
I tried it for /index.jsp and added the following in web.xml and it works fine for me. I used this in tomcat 6.0.10
<filter-name>Servlet Mapped Filter</filter-name>

hope this helps

SCJP 1.5, SCWCD 1.4, SCBCD 5
Tom Henricksen
Ranch Hand

Joined: Mar 23, 2004
Posts: 136

Yes that works

I agree. Here's the link: http://aspose.com/file-tools
subject: filter mapping to specific JSP
It's not a secret anymore!