Why SpringMVC Request method 'GET' not supported?

前端 未结 6 576
误落风尘
误落风尘 2020-12-01 05:34

I trying @RequestMapping(value = \"/test\", method = RequestMethod.POST) but is error

Code is

 @Controller
 public class HelloWordContr         


        
6条回答
  •  [愿得一人]
    2020-12-01 06:09

    I also had the same issue. I changed it to the following and it worked.

    Java :

    @RequestMapping(value = "/test", method = RequestMethod.GET)
    

    HTML code:

      

    By default if you do not specify http method in a form it uses GET. To use POST method you need specifically state it.

    Hope this helps.

提交回复
热议问题