Using PUT and DELETE methods in Spring MVC

前端 未结 2 1159
醉梦人生
醉梦人生 2020-12-01 09:26

I\'m trying to use RequestMethod.PUT and RequestMethod.DELETE in Spring MVC controller (version 3.0.2). There are three methods mapped with a URL i

相关标签:
2条回答
  • 2020-12-01 09:55

    You should change your config.

    <servlet-name>/*</servlet-name>  
    

    to

    <servlet-name>[dispatch servlet name]</servlet-name> 
    
    0 讨论(0)
  • 2020-12-01 10:15

    Most browsers do not support action=PUT in HTML forms. They will just send POST requests instead. The HiddenHttpMethodFilter will help you get around the problem, but you have to include a hidden field _method=PUT in your form. If you use the spring:form taglib this will be done automatically for you, but your example seems to use plain HTML.

    The NoSuchBeanDefinitionException is most probably an unrelated problem.

    0 讨论(0)
提交回复
热议问题