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 divert (redirect) a request from a filter? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "How to divert (redirect) a request from a filter?" Watch "How to divert (redirect) a request from a filter?" New topic
Author

How to divert (redirect) a request from a filter?

Rajesh Khan
Ranch Hand

Joined: Oct 16, 2011
Posts: 230
I am trying to redirect a request made to servlet "b" but instead servlet b does get called . Is there anything wrong with redirecting this way in a filter
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56185
    
  13

Is the filter actually being invoked?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Since you're not calling chain.doFilter(request, response) the servlet shouldn't be called at all. I'm with Bear on this one; make sure the filter is called in the first place.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: How to divert (redirect) a request from a filter?
 
Similar Threads
Servlet Filter Redirection
Filters
Servlet Filter Confusion
filter, chain.doFilter(request, response);
Servlet auto redirect to another page