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 filters in java Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
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: 19723
    
  20

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

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