本文整理汇总了Java中org.springframework.web.servlet.config.annotation.PathMatchConfigurer类的典型用法代码示例。如果您正苦于以下问题:Java PathMatchConfigurer类的具体用法?Java PathMatchConfigurer怎么用?Java PathMatchConfigurer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
PathMatchConfigurer类属于org.springframework.web.servlet.config.annotation包,在下文中一共展示了PathMatchConfigurer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
/**
* 设置路径匹配
*/
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer
//设置是否是后缀模式匹配,如"/user"是否匹配"/user.*",默认true
.setUseSuffixPatternMatch(false)
//设置是否自动后缀路径模式匹配,如"/user"是否匹配"/user/",默认true
.setUseTrailingSlashMatch(true);
}
示例2: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public final void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(false);
xmConfigurePathMatch(configurer);
}
示例3: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
super.configurePathMatch(configurer);
configurer.setUseSuffixPatternMatch(false);// /hello/1-2 and /hello/1-2.1 are not same
configurer.setUseTrailingSlashMatch(true); // /hello/ and /hello are same
}
示例4: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
/**
* PathMatchConfigurer 函数让开发人员可以根据需求定制URL路径的匹配规则。
*
* @param configurer
*/
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
/**
* spring mvc 默认忽略 url 中点"."后面的部分,如
* http://localhost:8080/abc.mm 会直接匹配为
* http://localhost:8080/abc 忽略了 mm
* 如果不想忽略,设置 setUseSuffixPatternMatch(false)
*/
configurer.setUseSuffixPatternMatch(false);
}
示例5: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
//This should make the url case insensitive
AntPathMatcher matcher = new AntPathMatcher();
matcher.setCaseSensitive(false);
configurer.setPathMatcher(matcher);
}
示例6: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
/**
* Configure the path match by disabling suffix pattern matching.
*
* @param configurer the path match configurer.
*/
@Override
public void configurePathMatch(PathMatchConfigurer configurer)
{
// Turn off suffix pattern matching which will ensure REST URL's that end with periods and some other text get matched in full and not without
// the period and the following text suffix. This is due to Spring's extension suffix matching logic that we don't need and don't want
// (e.g. .txt could be parsed by a specific handler).
configurer.setUseSuffixPatternMatch(false);
}
示例7: requestMappingHandlerMapping
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
/**
* Return a {@link RequestMappingHandlerMapping} ordered at 0 for mapping
* requests to annotated controllers.
*/
@Bean
@Override
public RequestMappingHandlerMapping requestMappingHandlerMapping() {
PathMatchConfigurer configurer = new PathMatchConfigurer();
configurePathMatch(configurer);
RequestMappingHandlerMapping handlerMapping = new RequestMappingHandlerMapping();
handlerMapping.setOrder(0);
handlerMapping.setDetectHandlerMethodsInAncestorContexts(true);
handlerMapping.setInterceptors(getInterceptors());
handlerMapping.setContentNegotiationManager(mvcContentNegotiationManager());
if (configurer.isUseSuffixPatternMatch() != null) {
handlerMapping.setUseSuffixPatternMatch(configurer.isUseSuffixPatternMatch());
}
if (configurer.isUseRegisteredSuffixPatternMatch() != null) {
handlerMapping.setUseRegisteredSuffixPatternMatch(configurer.isUseRegisteredSuffixPatternMatch());
}
if (configurer.isUseTrailingSlashMatch() != null) {
handlerMapping.setUseTrailingSlashMatch(configurer.isUseTrailingSlashMatch());
}
if (configurer.getPathMatcher() != null) {
handlerMapping.setPathMatcher(configurer.getPathMatcher());
}
if (configurer.getUrlPathHelper() != null) {
handlerMapping.setUrlPathHelper(configurer.getUrlPathHelper());
}
return handlerMapping;
}
示例8: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(false);
}
示例9: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
/**Optional. It's only required when handling '.' in @PathVariables which otherwise ignore everything after last '.' in @PathVaidables argument.
* It's a known bug in Spring [https://jira.spring.io/browse/SPR-6164], still present in Spring 4.1.7.
* This is a workaround for this issue.
*/
@Override
public void configurePathMatch(PathMatchConfigurer matcher) {
matcher.setUseRegisteredSuffixPatternMatch(true);
}
示例10: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(false);
}
示例11: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
// Fix handling of /api/v1/addon/org.openmrs.module.appui (otherwise appui is treated as a file extension)
configurer.setUseRegisteredSuffixPatternMatch(true);
}
示例12: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
super.configurePathMatch(configurer);
configurer.setUseSuffixPatternMatch(false);
}
示例13: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
AntPathMatcher matcher = new AntPathMatcher();
matcher.setCaseSensitive(false);
configurer.setPathMatcher(matcher);
}
示例14: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseTrailingSlashMatch(false);
configurer.setUseSuffixPatternMatch(false);
}
示例15: configurePathMatch
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(final PathMatchConfigurer configurer) {
//configurer.setUseSuffixPatternMatch(false);
configurer.setUseTrailingSlashMatch(true);
}