路径匹配参数设置
在spring mvc中,路径参数带".","."后面的值将会忽略。
http://localhost:8080/index.xx实际访问的路径是http://localhost:8080/index,注意的是
博主测试基于@Controller这种情况是生效的。基于viewController情况未能实现。
在spring mvc中,路径参数带".","."后面的值将会忽略。
http://localhost:8080/index.xx实际访问的路径是http://localhost:8080/index,注意的是
博主测试基于@Controller这种情况是生效的。基于viewController情况未能实现。
1.通过重写configurePathMatch方法可以不忽略"."后面的参数。
//不忽略"."后面的参数。
@Override
public void configurePathMatch(PathMatchConfigurer configurer) {
configurer.setUseSuffixPatternMatch(false);
}
设置前后对比: