This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Struts and the fly likes Redirects in Inceptor Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Redirects in Inceptor" Watch "Redirects in Inceptor" New topic

Redirects in Inceptor

shaf maff
Ranch Hand

Joined: Sep 07, 2008
Posts: 180
Hi Guys

I am working on an interceptor which is going to check for a session on password protected pages. I have setup an if statement which checks for the session. My question is how do I redirect back to the login page in the interceptor class ?


I tried to add something like <result name="test" type="redirect">/main/user/manager.jsp</result> into the struts file and then do a return "test"; but that wouldnt work.

David Newton

Joined: Sep 29, 2008
Posts: 12617

One way would be to have a global result that redirects to the logon action.
I agree. Here's the link:
subject: Redirects in Inceptor
Similar Threads
Struts 2 - passing request parameters to jsp from an Interceptor
Forwarding data struts.xml
Problem With Execute and Wait Interceptor
Interceptor messes up action class in Struts2
struts2 login interceptor not finding session attribute of user details.