当前位置: 首页>>代码示例>>Java>>正文


Java PathMatchConfigurer类代码示例

本文整理汇总了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);
}
 
开发者ID:drtrang,项目名称:dynamic-data-source-demo,代码行数:12,代码来源:SpringMvcConfig.java

示例2: configurePathMatch

import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
public final void configurePathMatch(PathMatchConfigurer configurer) {
    configurer.setUseSuffixPatternMatch(false);

    xmConfigurePathMatch(configurer);
}
 
开发者ID:xm-online,项目名称:xm-commons,代码行数:10,代码来源:XmWebMvcConfigurerAdapter.java

示例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

}
 
开发者ID:tvajjala,项目名称:interview-preparation,代码行数:8,代码来源:DispatchServletConfig.java

示例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);
}
 
开发者ID:h819,项目名称:spring-boot,代码行数:17,代码来源:WebMVCConfig.java

示例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);
}
 
开发者ID:NWQMC,项目名称:WQP-WQX-Services,代码行数:8,代码来源:SpringConfig.java

示例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);
}
 
开发者ID:FINRAOS,项目名称:herd,代码行数:14,代码来源:RestSpringModuleConfig.java

示例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;
}
 
开发者ID:Kixeye,项目名称:chassis,代码行数:32,代码来源:SpringMvcConfiguration.java

示例8: configurePathMatch

import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
    configurer.setUseSuffixPatternMatch(false);
}
 
开发者ID:xm-online,项目名称:xm-commons,代码行数:5,代码来源:TimelineConfig.java

示例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);
}
 
开发者ID:mustafamym,项目名称:FeedbackCollectionAndMgmtSystem,代码行数:9,代码来源:AppConfig.java

示例10: configurePathMatch

import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
	configurer.setUseSuffixPatternMatch(false);
}
 
开发者ID:longjiazuo,项目名称:springMvc4.x-project,代码行数:5,代码来源:MyMvcConfig.java

示例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);
}
 
开发者ID:openmrs,项目名称:openmrs-contrib-addonindex,代码行数:6,代码来源:WebMvcConfiguration.java

示例12: configurePathMatch

import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
    super.configurePathMatch(configurer);
    configurer.setUseSuffixPatternMatch(false);
}
 
开发者ID:react-dev26,项目名称:NGB-master,代码行数:6,代码来源:AppMVCConfiguration.java

示例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);
}
 
开发者ID:dockersamples,项目名称:atsea-sample-shop-app,代码行数:7,代码来源:WebConfiguration.java

示例14: configurePathMatch

import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
    configurer.setUseTrailingSlashMatch(false);
    configurer.setUseSuffixPatternMatch(false);
}
 
开发者ID:dlcs,项目名称:elucidate-server,代码行数:6,代码来源:MVCConfig.java

示例15: configurePathMatch

import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; //导入依赖的package包/类
@Override
public void configurePathMatch(final PathMatchConfigurer configurer) {
    //configurer.setUseSuffixPatternMatch(false);
    configurer.setUseTrailingSlashMatch(true);
}
 
开发者ID:HiOA-ABI,项目名称:nikita-noark5-core,代码行数:6,代码来源:AppWebMvcConfiguration.java


注:本文中的org.springframework.web.servlet.config.annotation.PathMatchConfigurer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。