Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The problem of servlet-name in the filter-mapping

 
Wei Geng
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,everyone

I found a problem when I set up the /ROOT/WEB-INF/web.xml. The case is

that when I change the setting as below:



the filter cannot be applied to the target servlet, but when I make the

the setting like this:



the filter was applied to the target servlet as expected.

My platform is WindowsXP(SP2)+J2sdk1.4.2_09+Tomcat5.5.12. I also

attempted to run the filter process as above on the platform of Tomcat4.3.1/Tomcat5.5.9. The problem remained.

I don't know what is wrong with my filter. Can you give me some advice?
Thank you!
 
Adeel Ansari
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Where is your <servlet-mapping> element?

Note: Name of your servlets and filters must be fully qualified.
[ October 28, 2005: Message edited by: Adeel Ansari ]
 
Wei Geng
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


If I added the codes which are bold font into the web.xml the filter would run all right. However the filter could not be applied to the target servlet without the setting of the <servlet-mapping>.
When I read the book of "SCWCD 1.4 Study Guide", I found it was not be mentioned about these details.
I wonder about the relative between the <filter-mapping> and <servlet-mapping>.
Thank you.
[ October 28, 2005: Message edited by: Wei Geng ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic