Example usage for org.apache.shiro.web.util WebUtils getRequestUri

List of usage examples for org.apache.shiro.web.util WebUtils getRequestUri

Introduction

In this page you can find the example usage for org.apache.shiro.web.util WebUtils getRequestUri.

Prototype

public static String getRequestUri(HttpServletRequest request) 

Source Link

Document

Return the request URI for the given request, detecting an include request URL if called within a RequestDispatcher include.

Usage

From source file:com.axelor.auth.AuthFilter.java

License:Open Source License

private boolean isRootWithoutSlash(ServletRequest request) {
    final HttpServletRequest req = (HttpServletRequest) request;
    final String ctx = WebUtils.getContextPath(req);
    final String uri = WebUtils.getRequestUri(req);
    return ctx != null && uri != null && !uri.endsWith("/") && ctx.length() == uri.length();
}

From source file:com.wegas.core.security.util.AuthenticationFilter.java

License:MIT License

/**
 *
 * @param request/*from  w  w w  .ja v a2s.  c o  m*/
 * @param response
 * @throws IOException
 */
@Override
protected void redirectToLogin(ServletRequest request, ServletResponse response) throws IOException {
    HttpServletRequest httpRequest = (HttpServletRequest) request;

    String url = WebUtils.getRequestUri(httpRequest);
    if (httpRequest.getQueryString() != null) {
        url += "?" + httpRequest.getQueryString();
    }
    WebUtils.issueRedirect(request, response, getLoginUrl() + "?redirect=" + URLEncoder.encode(url, "UTF-8"));
}