Avoid file extension detection in Spring MVC request mapping with floating point number in URI

前端 未结 3 878
时光取名叫无心
时光取名叫无心 2021-01-15 13:07

I used Spring Boot to implement a REST application. I have one resource that is mapped like this

@RequestMapping(value = \"/{fromLat}/{fromLon}/{toLat}/{toL         


        
3条回答
  •  野的像风
    2021-01-15 13:47

    I had similar issues with Spring Boot as described here.

    What worked for me is the following configuration:

    @Configuration
    public class WebMvcConfig extends WebMvcConfigurerAdapter {
    
        @Override
        public void configurePathMatch(PathMatchConfigurer configurer) {
            configurer.setUseSuffixPatternMatch(false);
    
        }
    
    
    }
    

提交回复
热议问题