Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

filter mapping to specific JSP

 
Tom Henricksen
Author
Ranch Hand
Posts: 144
5
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We can map to a specific servlet:

And we can do all JSPs:
<url-pattern>*.jsp</url-pattern>
But when I try to map to
<url-pattern>index.jsp</url-pattern>
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.

Thanks,
Tom
[ August 09, 2007: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you tried:
/index.jsp

or

*/index.jsp

?
 
Sundaram Karthick
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
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-mapping>
<filter-name>Servlet Mapped Filter</filter-name>
<url-pattern>/index.jsp</url-pattern>
</filter-mapping>

hope this helps
 
Tom Henricksen
Author
Ranch Hand
Posts: 144
5
Eclipse IDE jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
/index.jsp
Yes that works

Thanks,
Tom
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic