public static String getContextPath(HttpServletRequest request) {
        String contextPath = (String) request.getAttribute(INCLUDE_CONTEXT_PATH_ATTRIBUTE);
        if (contextPath == null) {
            contextPath = request.getContextPath();
        }
        contextPath = normalize(decodeRequestString(request, contextPath));
        if ("/".equals(contextPath)) {
            // the normalize method will return a "/" and includes on Jetty, will also be a "/".
            contextPath = "";
        }
        return contextPath;
    }
Return the context path for the given request, detecting an include request
URL if called within a RequestDispatcher include.
<p>As the value returned by <code>request.getContextPath()</code> is <i>not</i>
decoded by the servlet container, this method will decode it.

@param request current HTTP request
@return the context path
web/src/main/java/org/apache/shiro/web/util/WebUtils.java