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 OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP 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: 19725
    
  20

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: 61451
    
  67



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]
 
Consider Paul's rocket mass heater.
 
subject: How to find the servlet name that has been maped to a filter