1.自定义一个MyFormAuthenticationFilter 继承FormAuthenticationFilter
public class MyFormAuthenticationFilter extends FormAuthenticationFilter{
@Override
protected boolean onLoginSuccess(AuthenticationToken token,
Subject subject, ServletRequest request, ServletResponse response)
throws Exception {
HttpServletResponse httpResponse=(HttpServletResponse) response;
httpResponse.sendRedirect(“index.action”);
return true;
}
}
2.在 httpResponse.sendRedirect(url);指定你要跳转的url。
3.spring 中配置自定义FormAuthenticationFilter
4.ShiroFilterFactoryBean 配置中配置自定义FormAuthenticationFilter