spring boot 配置自己的 path 匹配规则
2017-01-19 15:58
891 查看
spring boot 配置自己的 path 匹配规则
how do
import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.web.servlet.config.annotation.PathMatchConfigurer; import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport; /** * @作者 Mitkey * @时间 2017年1月19日 下午3:31:26 * @类说明: * @版本 xx */ @SpringBootApplication public class Application extends WebMvcConfigurationSupport { public static void main(String[] args) { SpringApplication.run(Application.class, args); } @Override protected void configurePathMatch(PathMatchConfigurer configurer) { super.configurePathMatch(configurer); // 常用的两种 // 匹配结尾 / :会识别 url 的最后一个字符是否为 / // localhost:8080/test 与 localhost:8080/test/ 等价 configurer.setUseTrailingSlashMatch(true); // 匹配后缀名:会识别 xx.* 后缀的内容 // localhost:8080/test 与 localhost:8080/test.jsp 等价 configurer.setUseSuffixPatternMatch(true); // TODO PathMatchConfigurer 还提供其他的一些 api 以供使用 } }
相关文章推荐
- Spring Boot 定制URL匹配规则的方法
- (11)Spring Boot配置ContextPath【从零开始学Spring Boot】
- 直接使用security.basic.path无效|——springboot2.0以上的security的配置
- 75. Spring Boot 定制URL匹配规则【从零开始学Spring Boot】
- Spring Boot配置ContextPath【从零开始学Spring Boot】
- 分享知识-快乐自己:SpringBoot集成热部署配置(一)
- spring boot之spring mvc常用配置--路径匹配参数设置(7)
- SpringBoot+ZooKeeper+ZKUI+Drools 实现应用配置中心及业务规则动态加载
- Spring Boot 学习18--配置ContextPath
- spring boot之端口设置和contextpath的配置
- Spring Boot 揭秘与实战 自己实现一个简单的自动配置模块
- 11. 配置ContextPath【从零开始学Spring Boot】
- 11. 配置ContextPath【从零开始学Spring Boot】
- 75. Spring Boot 定制URL匹配规则【从零开始学Spring Boot】
- spring boot配置shiro自定义shiro filter匹配异常
- springboot读取自己定义的配置文件的方式以及使用joda_time来处理时间日期
- springboot源码解析:自己实现一个springboot自动配置
- springboot配置ContextPath(配置全局过滤URl)
- 11. 配置ContextPath【从零开始学Spring Boot】
- spring boot连接eureka的时候,statusPageUrlPath、healthCheckUrlPath的配置