File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes How to find the servlet name that has been maped to a filter Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "How to find the servlet name that has been maped to a filter" Watch "How to find the servlet name that has been maped to a filter" New topic
Author

How to find the servlet name that has been maped to a filter

nacassa sam
Greenhorn

Joined: Mar 27, 2012
Posts: 7
I have a filter class and i need to get the servlet name mapped to a filter (filter mapping object has the filter name and the corresponding servlet name, I need to get the servlet name from the mapping) is there any way in servlet api 2.5 to do this?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19655
    
  18

Why would your filter need to know this information? It shouldn't care what the next step in handling the request is, and just call doFilter on the FilterChain. The web container will then make sure the next step (another filter, a servlet, a JSP file, static content) is called.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60802
    
  65



I agree with Rob. The fact that you think that you need this is a good indication of a design flaw. Why do you feel that you need this information, and what do you plan to do with it?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: How to find the servlet name that has been maped to a filter
 
Similar Threads
Filter
Using a filter to secure a set of servlets.
t:inputCalendar in JSF having probelms with Tomahawk1.1.3
Q: Filter on Page 668 and page 695
Call a servlet on the url pattern /_/