List of usage examples for org.apache.shiro.web.util WebUtils issueRedirect
public static void issueRedirect(ServletRequest request, ServletResponse response, String url, Map queryParams, boolean contextRelative) throws IOException
From source file:cn.com.cowboy.nosql_mvc.web.filter.CustomFormAuthenticationFilter.java
License:Apache License
@Override protected boolean onLoginFailure(AuthenticationToken token, AuthenticationException e, ServletRequest request, ServletResponse response) {//from w w w . j a va 2s .c o m super.onLoginFailure(token, e, request, response); try { boolean contextRelative = true; // true?falsepostlogin?mvc:resource??? // ?false?WebUtils.redirectToSavedRequestrequest?? WebUtils.issueRedirect(request, response, getLoginUrl(), null, contextRelative); return false; } catch (IOException e1) { e1.printStackTrace(); return true; } }
From source file:com.funtl.framework.smoke.core.modules.sys.security.FormAuthenticationFilter.java
License:Apache License
@Override protected void issueSuccessRedirect(ServletRequest request, ServletResponse response) throws Exception { // Principal p = UserUtils.getPrincipal(); // if (p != null && !p.isMobileLogin()){ WebUtils.issueRedirect(request, response, getSuccessUrl(), null, true); // }else{ // super.issueSuccessRedirect(request, response); // }/*ww w. ja va 2 s .c o m*/ }