• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

filters in java

 
vinitha simon
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 20494
54
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
vinitha simon
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64618
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
vinitha simon
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all ! I did chain it, and it works fine !
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic