use of org.springframework.web.util.UrlPathHelper in project spring-boot by spring-projects.
the class WebMvcAutoConfigurationTests method urlPathHelperUsesFullPathByDefault.
@Test
void urlPathHelperUsesFullPathByDefault() {
this.contextRunner.run((context) -> {
UrlPathHelper urlPathHelper = context.getBean(UrlPathHelper.class);
assertThat(urlPathHelper).extracting("alwaysUseFullPath").isEqualTo(true);
});
}
use of org.springframework.web.util.UrlPathHelper in project spring-boot by spring-projects.
the class WebMvcAutoConfigurationTests method urlPathHelperDoesNotUseFullPathWithAdditionalDispatcherServlet.
@Test
void urlPathHelperDoesNotUseFullPathWithAdditionalDispatcherServlet() {
this.contextRunner.withUserConfiguration(AdditionalDispatcherServletConfiguration.class).run((context) -> {
UrlPathHelper urlPathHelper = context.getBean(UrlPathHelper.class);
assertThat(urlPathHelper).extracting("alwaysUseFullPath").isEqualTo(false);
});
}
use of org.springframework.web.util.UrlPathHelper in project spring-boot by spring-projects.
the class WebMvcAutoConfigurationTests method urlPathHelperDoesNotUseFullPathWithServletMapping.
@Test
void urlPathHelperDoesNotUseFullPathWithServletMapping() {
this.contextRunner.withPropertyValues("spring.mvc.servlet.path=/test/").run((context) -> {
UrlPathHelper urlPathHelper = context.getBean(UrlPathHelper.class);
assertThat(urlPathHelper).extracting("alwaysUseFullPath").isEqualTo(false);
});
}
use of org.springframework.web.util.UrlPathHelper in project CzechIdMng by bcvsolutions.
the class WebConfig method configurePathMatch.
/**
* Whether to use suffix pattern match (".*") when matching patterns to
* requests. If enabled a method mapped to "/users" also matches to
* "/users.*".
* <p>
* By default this is set to {@code true}.
*/
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
// enable encoded slash in path parameters
UrlPathHelper urlPathHelper = new UrlPathHelper();
urlPathHelper.setUrlDecode(false);
configurer.setUrlPathHelper(urlPathHelper);
//
// disable extension suffixes
configurer.setUseSuffixPatternMatch(Boolean.FALSE);
//
// this will be useful in future ...
// configurer.setUseRegisteredSuffixPatternMatch(true);
}
use of org.springframework.web.util.UrlPathHelper in project tutorials by eugenp.
the class WebConfig method configurePathMatch.
@Override
public void configurePathMatch(final PathMatchConfigurer configurer) {
final UrlPathHelper urlPathHelper = new UrlPathHelper();
urlPathHelper.setRemoveSemicolonContent(false);
configurer.setUrlPathHelper(urlPathHelper);
}
Aggregations