spring boot之spring mvc常用配置--路径匹配参数设置(7)
2018-02-05 14:17
701 查看
路径匹配参数设置
在spring mvc中,路径参数带".","."后面的值将会忽略。
http://localhost:8080/index.xx实际访问的路径是http://localhost:8080/index,注意的是
博主测试基于@Controller这种情况是生效的。基于viewController情况未能实现。
1.通过重写configurePathMatch方法可以不忽略"."后面的参数。
//不忽略"."后面的参数。
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(false);
}
设置前后对比:
在spring mvc中,路径参数带".","."后面的值将会忽略。
http://localhost:8080/index.xx实际访问的路径是http://localhost:8080/index,注意的是
博主测试基于@Controller这种情况是生效的。基于viewController情况未能实现。
1.通过重写configurePathMatch方法可以不忽略"."后面的参数。
//不忽略"."后面的参数。
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(false);
}
设置前后对比:
相关文章推荐
- 12-SpringBoot——Spring MVC基础-常用配置
- spring boot之spring mvc常用配置--viewController(6)
- spring boot之spring mvc常用配置-静态资源映射(3)
- spring boot之spring mvc常用配置--服务器端推送技术基于jquery(10)
- spring boot之spring mvc常用配置--文件上传(8)
- spring boot之spring mvc常用配置--拦截器配置(4)
- spring boot之spring mvc常用配置--自定义HtppMessageConverter(9)
- spring-boot常用参数配置说明
- springboot(2)-springboot中的配置文件设置之(修改访问端口和访问路径)
- spring boot之spring mvc常用配置--@controllerAdvice(5)
- springboot中使用定时任务,异步调用,自定义配置参数(八)
- spring boot 设置tomcat post参数限制
- Spring Boot对Spring MVC的配置
- 04-SpringBoot——Spring常用配置-Bean的Scope
- springboot学习笔记-2 一些常用的配置以及整合mybatis
- spring boot配置shiro自定义shiro filter匹配异常
- Spring学习5_ Spring MVC与mybatis学习-----参数配置文件说明
- SpringBoot velocity 模板配置绝对路径的资源路径
- Spring Boot 2.0.0.M3使用案例,案例配置,常用命令,注解介绍,热部署
- struts2 笔记01 登录、常用配置参数、Action访问Servlet API 和设置Action中对象的值、命名空间和乱码处理、Action中包含多个方法如何调用