Hi,
look at line:
return Action.LOGIN;
this is the place where interceptor is returning simple string which
represents forward,
in my case i have "logon" defined in struts.xml
like this:
<global-results>
<result name="logon">/WEB-INF/pages/logon.jsp</result>
</global-results>
Hope that helps,
Paweł Wielgus.
2009/4/16 Baran <[email protected]>:
>
> Hi,
>
> I guess I am fine with the intercepter side, but the issue is I am not able
> to redirect it to a new page. The intercepter is working fine, but the
> respone is coming back to the same page and not to the login page.
>
> Any thing that I might be missing in the struts.xml or somewhere? coz
> intercepter is fine all I need is to send it to new page.
>
> Thanks
>
> Lukasz Lenart wrote:
>>
>> package example3;
>>
>> import com.opensymphony.xwork2.Action;
>> import com.opensymphony.xwork2.ActionInvocation;
>> import com.opensymphony.xwork2.interceptor.Interceptor;
>>
>> /**
>> *
>> * @author Lukasz
>> */
>> public class LoginInterceptor implements Interceptor {
>>
>> public void destroy() {
>> }
>>
>> public void init() {
>> }
>>
>> public String intercept(ActionInvocation arg0) throws Exception {
>> if (arg0.getAction() instanceof LoginAction) {
>> return arg0.invoke();
>> }
>> String user = (String)
>> arg0.getInvocationContext().getSession().get("user");
>> if ( user == null || "".equals(user)) {
>> return Action.LOGIN;
>> } else {
>> return arg0.invoke();
>> }
>> }
>>
>> }
>>
>>
>> Regards
>> --
>> Lukasz
>> http://www.lenart.org.pl/
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>>
>>
>
> --
> View this message in context:
> http://www.nabble.com/Session-Management-tp23074591p23075474.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]