• Post Reply Bookmark Topic Watch Topic
  • New Topic

Servlel Filters  RSS feed

 
Ram Chhabra
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have 100 java classes and i created 1 filter which i configured in web.xml.

Now what i want that except for one class, all request should go through that filters.

Thanks
 
Ankit Garg
Sheriff
Posts: 9610
37
Android Google Web Toolkit Hibernate IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well there is no way to apply a filter on all URLs except for one. You'll have to map your filter to all the URLs i.e. /* and then in your filter, check the one servlet on which you don't want to apply the filter. If there is a better way, then I don't know about it...
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can specify more than one url-pattern for one filter.

The choice is to you: 100 url-patterns and an unchanged filter code, OR 1 generic url-pattern and a filter code change to check 1 negative url-pattern.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!