Examples of UrlPathHelper


Examples of org.springframework.web.util.UrlPathHelper

   * @param response current HTTP response
   * @throws Exception if preparing the response failed
   */
  protected void noHandlerFound(HttpServletRequest request, HttpServletResponse response) throws Exception {
    if (pageNotFoundLogger.isWarnEnabled()) {
      String requestUri = new UrlPathHelper().getRequestUri(request);
      pageNotFoundLogger.warn("No mapping for [" + requestUri +
          "] in DispatcherServlet with name '" + getServletName() + "'");
    }
    response.sendError(HttpServletResponse.SC_NOT_FOUND);
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

    // Determine default HTML escape setting from the "defaultHtmlEscape"
    // context-param in web.xml, if any.
    this.defaultHtmlEscape = WebUtils.getDefaultHtmlEscape(this.webApplicationContext.getServletContext());

    this.urlPathHelper = new UrlPathHelper();

    try {
      this.requestDataValueProcessor = this.webApplicationContext.getBean(
          REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME, RequestDataValueProcessor.class);
    }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

   * Return a builder initialized with the host, port, scheme, and the
   * context path of the given request.
   */
  public static ServletUriComponentsBuilder fromContextPath(HttpServletRequest request) {
    ServletUriComponentsBuilder builder = fromRequest(request);
    builder.replacePath(new UrlPathHelper().getContextPath(request));
    builder.replaceQuery(null);
    return builder;
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

   * path is not mapped by name, i.e. {@code "/"} or {@code "*.html"}, then
   * the resulting path will contain the context path only.
   */
  public static ServletUriComponentsBuilder fromServletMapping(HttpServletRequest request) {
    ServletUriComponentsBuilder builder = fromContextPath(request);
    if (StringUtils.hasText(new UrlPathHelper().getPathWithinServletMapping(request))) {
      builder.path(request.getServletPath());
    }
    return builder;
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

    builder.scheme(scheme);
    builder.host(request.getServerName());
    if ((scheme.equals("http") && port != 80) || (scheme.equals("https") && port != 443)) {
      builder.port(port);
    }
    builder.path(new UrlPathHelper().getRequestUri(request));
    builder.query(request.getQueryString());
    return builder;
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

                   UrlPathHelper urlPathHelper,
                   PathMatcher pathMatcher,
                   boolean useSuffixPatternMatch,
                   boolean useTrailingSlashMatch) {
    this.patterns = Collections.unmodifiableSet(prependLeadingSlash(patterns));
    this.urlPathHelper = urlPathHelper != null ? urlPathHelper : new UrlPathHelper();
    this.pathMatcher = pathMatcher != null ? pathMatcher : new AntPathMatcher();
    this.useSuffixPatternMatch = useSuffixPatternMatch;
    this.useTrailingSlashMatch = useTrailingSlashMatch;
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

    // Determine default HTML escape setting from the "defaultHtmlEscape"
    // context-param in web.xml, if any.
    this.defaultHtmlEscape = WebUtils.getDefaultHtmlEscape(this.webApplicationContext.getServletContext());

    this.urlPathHelper = new UrlPathHelper();

    try {
      this.requestDataValueProcessor = this.webApplicationContext.getBean(
          REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME, RequestDataValueProcessor.class);
    }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

   * {@code "/"} or {@code "*.do"}, the result will be the same as
   * if calling {@link #fromContextPath(HttpServletRequest)}.
   */
  public static ServletUriComponentsBuilder fromServletMapping(HttpServletRequest request) {
    ServletUriComponentsBuilder builder = fromContextPath(request);
    if (StringUtils.hasText(new UrlPathHelper().getPathWithinServletMapping(request))) {
      builder.path(request.getServletPath());
    }
    return builder;
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  private PatternsRequestCondition(Collection<String> patterns, UrlPathHelper urlPathHelper,
      PathMatcher pathMatcher, boolean useSuffixPatternMatch, boolean useTrailingSlashMatch,
      List<String> fileExtensions) {

    this.patterns = Collections.unmodifiableSet(prependLeadingSlash(patterns));
    this.urlPathHelper = urlPathHelper != null ? urlPathHelper : new UrlPathHelper();
    this.pathMatcher = pathMatcher != null ? pathMatcher : new AntPathMatcher();
    this.useSuffixPatternMatch = useSuffixPatternMatch;
    this.useTrailingSlashMatch = useTrailingSlashMatch;
    if (fileExtensions != null) {
      for (String fileExtension : fileExtensions) {
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

   * Exposes the DispatcherServlet-specific request attributes and
   * delegates to {@link #doDispatch} for the actual dispatching.
   */
  protected void doService(HttpServletRequest request, HttpServletResponse response) throws Exception {
    if (logger.isDebugEnabled()) {
      String requestUri = new UrlPathHelper().getRequestUri(request);
      logger.debug(
          "DispatcherServlet with name '" + getServletName() + "' received request for [" + requestUri + "]");
    }

    // Keep a snapshot of the request attributes in case of an include,
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.