/** * Return the context path of the original request, that is, the path that * indicates the current web application. This is useful for building links * to other resources within the application. * <p>Delegates to the UrlPathHelper for decoding. * @see javax.servlet.http.HttpServletRequest#getContextPath * @see #getUrlPathHelper */ public String getContextPath() { return this.urlPathHelper.getOriginatingContextPath(this.request); }
/** * Return the context path of the original request, that is, the path that * indicates the current web application. This is useful for building links * to other resources within the application. * <p>Delegates to the UrlPathHelper for decoding. * @see javax.servlet.http.HttpServletRequest#getContextPath * @see #getUrlPathHelper */ public String getContextPath() { return this.urlPathHelper.getOriginatingContextPath(this.request); }
/** * Return the path to URL mappings within the current servlet including the * context path and the servlet path of the original request. This is useful * for building links to other resources within the application where a * servlet mapping of the style {@code "/main/*"} is used. * <p>Delegates to the UrlPathHelper to determine the context and servlet path. */ public String getPathToServlet() { String path = this.urlPathHelper.getOriginatingContextPath(this.request); if (StringUtils.hasText(this.urlPathHelper.getPathWithinServletMapping(this.request))) { path += this.urlPathHelper.getOriginatingServletPath(this.request); } return path; }
/** * Return the path to URL mappings within the current servlet including the * context path and the servlet path of the original request. This is useful * for building links to other resources within the application where a * servlet mapping of the style {@code "/main/*"} is used. * <p>Delegates to the UrlPathHelper to determine the context and servlet path. */ public String getPathToServlet() { String path = this.urlPathHelper.getOriginatingContextPath(this.request); if (StringUtils.hasText(this.urlPathHelper.getPathWithinServletMapping(this.request))) { path += this.urlPathHelper.getOriginatingServletPath(this.request); } return path; }
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { String path = urlPathHelper.getLookupPathForRequest(request); String ctxPath = urlPathHelper.getOriginatingContextPath(request); if (adminContextPath.equals(path)) { try {
@Override public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) { String path = urlPathHelper.getLookupPathForRequest(request); String ctxPath = urlPathHelper.getOriginatingContextPath(request); if (adminContextPath.equals(path)) { try {
/** * Return the context path of the original request, that is, the path that * indicates the current web application. This is useful for building links * to other resources within the application. * <p>Delegates to the UrlPathHelper for decoding. * @see HttpServletRequest#getContextPath * @see #getUrlPathHelper */ public String getContextPath() { return this.urlPathHelper.getOriginatingContextPath(this.request); }
/** * Return the context path for the given request, detecting an include request * URL if called within a RequestDispatcher include. * @see UrlPathHelper#getOriginatingContextPath(HttpServletRequest) */ public static String getOriginatingContextPath(HttpServletRequest request) { return urlPathHelper.getOriginatingContextPath(request); }
private String contextPath() { return urlPathHelper.getOriginatingContextPath(servletRequest); }
public static String getURI(HttpServletRequest request) { UrlPathHelper helper = new UrlPathHelper(); String uri = helper.getOriginatingRequestUri(request); String ctx = helper.getOriginatingContextPath(request); if (!StringUtils.isBlank(ctx)) { return uri.substring(ctx.length()); } else { return uri; } }
/** * Return the path to URL mappings within the current servlet including the * context path and the servlet path of the original request. This is useful * for building links to other resources within the application where a * servlet mapping of the style {@code "/main/*"} is used. * <p>Delegates to the UrlPathHelper to determine the context and servlet path. */ public String getPathToServlet() { String path = this.urlPathHelper.getOriginatingContextPath(this.request); if (StringUtils.hasText(this.urlPathHelper.getPathWithinServletMapping(this.request))) { path += this.urlPathHelper.getOriginatingServletPath(this.request); } return path; }