aspose 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 | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Servlets
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: 61433
    
  67

Is the filter actually being invoked?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19720
    
  20

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 - OCEEJBD 6
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How to divert (redirect) a request from a filter?