How to change Spring MVC's behavior in handling url 'dot' character

前端 未结 6 635
耶瑟儿~
耶瑟儿~ 2020-12-06 11:40

I\'m trying to migrate a web project off from Jersey to Spring MVC 3.0. The process was really straightforward up to the moment when I started to migrate the controllers sup

6条回答
  •  无人及你
    2020-12-06 12:12

    Try this:

    
            
        
    

    This should make it so that Spring won't try to parse extensions.

    See also: Spring MVC @PathVariable getting truncated

    And: Spring Documentation

    Potential config files:

    web.xml (where I set the servlet stuff)

    
        Spring MVC Dispatcher Servlet
        org.springframework.web.servlet.DispatcherServlet
        
        
            contextConfigLocation
            
                /WEB-INF/spring/*.xml,classpath*:applicationContext.xml,classpath*:restApplicationContext.xml
            
        
        2
    
    

    And then in WEB/INF/spring/mvc-config.xml I have something like this:

    
    
    
        
            
        
    
    

提交回复
热议问题