Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Servlets
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Paul Clapham
Ron McLeod
Jeanne Boyarsky
Tim Cooke
Sheriffs:
Liutauras Vilda
paul wheaton
Henry Wong
Saloon Keepers:
Tim Moores
Tim Holloway
Stephan van Hulst
Carey Brown
Frits Walraven
Bartenders:
Piet Souris
Himai Minh
Forum:
Servlets
Filter in servlet
Mukesh Prajapati
Greenhorn
Posts: 10
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Marshal
Posts: 27211
87
I like...
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Yes, it is possible.
Why do you ask? Did you have some problem when you tried to do it?
Bosun Bello
Ranch Hand
Posts: 1512
posted 10 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
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
Posts: 113
posted 10 years ago
1
Number of slices to send:
Optional 'thank-you' note:
Send
And an example:
<servlet-mapping> <servlet-name>Servlet1</servlet-name> <url-pattern>/servlet1</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>Servlet2</servlet-name> <url-pattern>/servlet2</url-pattern> </servlet-mapping> <!-- this filter will run for all servlets in this web app --> <filter-mapping> <filter-name>Servlet2</servlet-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- OR you can do something like this --> <filter-mapping> <filter-name>Servlet2</servlet-name> <servlet-name>Servlet1</servlet-name> <servlet-name>Servlet2</servlet-name> <!-- more servlet names here --> </filter-mapping>
Get meta with me! What pursues us is our own obsessions! But not this tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Struts Filter
Return to Login Page
url rewrite
Redirecting to login.jsp page?
Tracking users and user security
More...