Example usage for org.springframework.web.util WebUtils FORWARD_CONTEXT_PATH_ATTRIBUTE

List of usage examples for org.springframework.web.util WebUtils FORWARD_CONTEXT_PATH_ATTRIBUTE

Introduction

In this page you can find the example usage for org.springframework.web.util WebUtils FORWARD_CONTEXT_PATH_ATTRIBUTE.

Prototype

String FORWARD_CONTEXT_PATH_ATTRIBUTE

To view the source code for org.springframework.web.util WebUtils FORWARD_CONTEXT_PATH_ATTRIBUTE.

Click Source Link

Document

Standard Servlet 2.4+ spec request attribute for forward context path.

Usage

From source file:org.springframework.web.util.UrlPathHelper.java

/**
 * 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()} is <i>not</i>
 * decoded by the servlet container, this method will decode it.
 * @param request current HTTP request/*from www .jav  a2 s  .  com*/
 * @return the context path
 */
public String getOriginatingContextPath(HttpServletRequest request) {
    String contextPath = (String) request.getAttribute(WebUtils.FORWARD_CONTEXT_PATH_ATTRIBUTE);
    if (contextPath == null) {
        contextPath = request.getContextPath();
    }
    return decodeRequestString(request, contextPath);
}