aspose file tools*
The moose likes Servlets and the fly likes Filter in servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Filter in servlet" Watch "Filter in servlet" New topic
Author

Filter in servlet

Mukesh Prajapati
Greenhorn

Joined: Feb 02, 2011
Posts: 10
is it possible to apply one Filter to more than two Servlet??? please reply soon...... please give me such example. how to do it?
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18910
    
    8

Yes, it is possible.

Why do you ask? Did you have some problem when you tried to do it?
Bosun Bello
Ranch Hand

Joined: Nov 06, 2000
Posts: 1510
You can just map the filter to be executed on the urls that match your servlets.


Bosun (SCJP, SCWCD)
So much trouble in the world -- Bob Marley
Stoian Azarov
Ranch Hand

Joined: Jun 01, 2011
Posts: 113
And an example:
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Filter in servlet