title: spring boot post modelandview error
body: <p>I'm doing work on angularjs and spring boot .</p>
  
  <p>My work request works well for <code>HTTP GET</code>s,
  but I'm having problems with the <code>POST</code> request controller returning <code>null</code></p>
  
  <p>This is working:</p>
  
  <pre><code>@RequestMapping(value="/foo.do", method=RequestMethod.GET)
  @ResponseBody
  public ModelAndView indexStringGet(Model model, @RequestParam(id) String orderId,
          HttpServletRequest request){
      System.out.println("=== get Index");//
      System.out.println("=== orderId" + orderId);
  
       String path = request.getContextPath();        
       System.out.println("== path" + path);
      ModelAndView mv = new ModelAndView();
      mv.setViewName("test1");
      return mv;
  }   
  </code></pre>
  
  <p>but this Request method 'POST' not supported</p>
  
  <pre><code>@RequestMapping(value="/foo.do", method=RequestMethod.POST)
  @ResponseBody
  public ModelAndView indexStringPost(Model model, @RequestParam(id) String orderId,
  HttpServletRequest request){
  System.out.println("=== get Index");//
  System.out.println("=== orderId" + orderId);
  
   String path = request.getContextPath();        
   System.out.println("== path" + path);
  ModelAndView mv = new ModelAndView();
  mv.setViewName("test1");
  return mv;
  }   
  </code></pre>
  
  <p>this is the result: </p>
  
  <pre><code>"status": 405,
  "error": "Method Not Allowed",
  "exception": "org.springframework.web.HttpRequestMethodNotSupportedException",
  "message": "Request method 'POST' not supported",
  "path": "/SpringBoot/test1"
  </code></pre>
  
  <p>Thanks</p>