0

I am trying to check the form parameter in my spring controller class but getting below error

Invalid request method: Request method 'POST' not supportedException-Message: Request method 'POST' not supportedRequest-Info-----

Current-Request-URL=http://sit-www.hm.com/view/checkout/submitCurrent-Request-URI=/view/checkout/submitForward-Request-Uri=/de/checkout/submitForward-Query-String=nullInclude-Request-Uri=nullInclude-Query-String=nullMethod=POSTRemoteAddr=193.234.233.229--------- Session info"

Java script code :

elements.formCheckout.append($('<input type="hidden" name="New-submit" />'));

Controller class in spring:

 @RequestMapping(value = ACTION_SUBMIT, method = POST, params = "New-submit")
    public ModelAndView submitOrder(@Valid @ModelAttribute(PATH) CheckoutComponentDTO form, BindingResult result,
            HttpServletRequest request, HttpServletResponse response) {

I added param="New-submit" to check in controller class but it is showing

Invalid request method: Request method 'POST' not supportedException-Message.

Please help me on this.

Sumesh TG
  • 2,557
  • 2
  • 15
  • 29
Sumant
  • 21
  • 2

1 Answers1

0

As I think you are not using calling the method of type POST from javascript here is the code to call post method from javascript.

how to send data in POST method using javascript

Harsh Kumrawat
  • 160
  • 1
  • 2
  • 16