That's it, I code an interceptor login, the result is
<result name="login" type="redirectAction">access</result>
All works ok, but I think that is recalling it, the result go to access and again execute the interceptor and go access etc. I believe that because my browser shows the message:
the page is not redirecting properly.
I'm using Struts 2 and Rest plugin.
This is my interceptor:
@Override
public String intercept(ActionInvocation invocation) throws Exception {
HttpSession session = ServletActionContext.getRequest().getSession(false);
Object loginObject = session.getAttribute("login");
boolean login = false;
if (loginObject != null) {
login = (Boolean) loginObject;
if (!login) {
return Action.LOGIN;
} else {
return invocation.invoke();
}
} else {
return Action.LOGIN;
}