my dog learned polymorphism*
The moose likes Servlets and the fly likes filters in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "filters in java" Watch "filters in java" New topic
Author

filters in java

vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
hi,
I would like to know how to redirect a filter to the request URL itself... I have tried




but, it does not seem to work.

Any help is appreciated.
TIA
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19541
    
  16

Why would you want to do that? It will call the same filters / servlet again, and again, and again, and again...

Anyway, moving to our servlet forum.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
Ok. I have a filter which checks if the user is already logged in. If the user has not logged in, it redirects the user to the login page, but, if the user is already logged in, I just want to be able to process the user's request ie, forward/redirect to the user specified url.

Any suggestions.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60046
    
  65

You don't redirect in that case; you call the next resource in the filter chain. Any tutorial on filters will show you the correct pattern.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
vinitha simon
Ranch Hand

Joined: Dec 13, 2007
Posts: 64
Thanks all ! I did chain it, and it works fine !
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: filters in java
 
Similar Threads
JSP called from filter not finding JavaScript file
for loop question
lockCookie
assignments and + operator
Access a variable