hey,guys, the code follows,
public class LoginInterceptor extends AbstractInterceptor {
private String* redirectUrl*;
public String getRedirectUrl() {
return redirectUrl;
}
public void setRedirectUrl(String redirectUrl) {
this.redirectUrl = redirectUrl;
}
@Override
public String intercept(ActionInvocation arg0) throws Exception {
System.out.println("Come into the LoginInterceptor#intercept()");
ActionContext ctx = arg0.getInvocationContext();
User user = (User) ctx.getSession().get("user");
if(user!= null){
return arg0.invoke();
}
ctx.put("tip", "请先登录系统:)");
Map params = ActionContext.getContext().getParameters();
*redirectUrl* = "*buildSendReq.action*
?productID=11&productTitle=Games+Explorer";
System.out.println("RedirectUrl="+redirectUrl);
System.out.println("Intercept() ok!");
* return Action.LOGIN; // Login.action , I want to pass the
redirectUrl to the Login.action. How to do ???*
}
}