Examples of UrlPathHelper


Examples of org.springframework.web.util.UrlPathHelper

    // context-param in web.xml, if any.
    this.defaultHtmlEscape = WebUtils.getDefaultHtmlEscape(this.webApplicationContext.getServletContext());

    this.responseEncodedHtmlEscape = WebUtils.getResponseEncodedHtmlEscape(this.webApplicationContext.getServletContext());

    this.urlPathHelper = new UrlPathHelper();

    if (this.webApplicationContext.containsBean(REQUEST_DATA_VALUE_PROCESSOR_BEAN_NAME)) {
      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

  }

  @Bean
  public ResourceUrlProvider mvcResourceUrlProvider() {
    ResourceUrlProvider urlProvider = new ResourceUrlProvider();
    UrlPathHelper pathHelper = getPathMatchConfigurer().getUrlPathHelper();
    if (pathHelper != null) {
      urlProvider.setUrlPathHelper(pathHelper);
    }
    PathMatcher pathMatcher = getPathMatchConfigurer().getPathMatcher();
    if (pathMatcher != null) {
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  public UrlPathHelper mvcUrlPathHelper() {
    if (getPathMatchConfigurer().getUrlPathHelper() != null) {
      return getPathMatchConfigurer().getUrlPathHelper();
    }
    else {
      return new UrlPathHelper();
    }
  }
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  @Test
  public void uriTemplateVariables() {
    PatternsRequestCondition patterns = new PatternsRequestCondition("/{path1}/{path2}");
    RequestMappingInfo key = new RequestMappingInfo(patterns, null, null, null, null, null, null);
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/1/2");
    String lookupPath = new UrlPathHelper().getLookupPathForRequest(request);
    this.handlerMapping.handleMatch(key, lookupPath, request);

    @SuppressWarnings("unchecked")
    Map<String, String> uriVariables =
      (Map<String, String>) request.getAttribute(
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  public void uriTemplateVariablesDecode() {
    PatternsRequestCondition patterns = new PatternsRequestCondition("/{group}/{identifier}");
    RequestMappingInfo key = new RequestMappingInfo(patterns, null, null, null, null, null, null);
    MockHttpServletRequest request = new MockHttpServletRequest("GET", "/group/a%2Fb");

    UrlPathHelper pathHelper = new UrlPathHelper();
    pathHelper.setUrlDecode(false);
    String lookupPath = pathHelper.getLookupPathForRequest(request);

    this.handlerMapping.setUrlPathHelper(pathHelper);
    this.handlerMapping.handleMatch(key, lookupPath, request);

    @SuppressWarnings("unchecked")
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  @Test
  public void matrixVariablesDecoding() {

    MockHttpServletRequest request;

    UrlPathHelper urlPathHelper = new UrlPathHelper();
    urlPathHelper.setUrlDecode(false);
    urlPathHelper.setRemoveSemicolonContent(false);

    this.handlerMapping.setUrlPathHelper(urlPathHelper );

    request = new MockHttpServletRequest();
    testHandleMatch(request, "/path{filter}", "/path;mvar=a%2fb");
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  }

  @Test
  public void defaultPathMatchConfiguration() throws Exception {
    ApplicationContext context = initContext(WebConfig.class);
    UrlPathHelper urlPathHelper = context.getBean(UrlPathHelper.class);
    PathMatcher pathMatcher = context.getBean(PathMatcher.class);

    assertNotNull(urlPathHelper);
    assertNotNull(pathMatcher);
    assertEquals(AntPathMatcher.class, pathMatcher.getClass());
View Full Code Here

Examples of org.springframework.web.util.UrlPathHelper

  }

  @Test
  public void configurePathMatch() throws Exception {
    final PathMatcher pathMatcher = mock(PathMatcher.class);
    final UrlPathHelper pathHelper = mock(UrlPathHelper.class);

    List<WebMvcConfigurer> configurers = new ArrayList<WebMvcConfigurer>();
    configurers.add(new WebMvcConfigurerAdapter() {
      @Override
      public void configurePathMatch(PathMatchConfigurer configurer) {
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();
  }
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.