title: Spring Boot - POST Request Method did not work but GET did
body: <p>I am learning Spring Boot now and I wrote a small application. The application has this controller:</p>
  
  <pre><code>@Controller
  @RequestMapping("/")
  public class ApplicationController {
  
     @RequestMapping(value="/account", method = RequestMethod.POST) 
     public String getAccountVo(ModelMap model) {
         AccountVO vo = new AccountVO();
         vo.setAccountNo("0102356");
         vo.setAccountHolderName("Dinesh");
  
         model.addAttribute("acc", vo);
  
         return "account";
     }
  }
  </code></pre>
  
  <p>... and the page (view) is:</p>
  
  <pre><code>&lt;%@ page language="java" contentType="text/html; charset=UTF-8"
      pageEncoding="UTF-8"%&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt;
  &lt;title&gt;Account Details&lt;/title&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form&gt;
          Account number &lt;input type="text" name="acctNo" value="${acc.getAccountNo()}"&gt;&lt;br&gt;
          Account Holder Name &lt;input type="text" name="name" value="${acc.getAccountHolderName()}"&gt;&lt;br&gt;
      &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>When I ran the application, I got <code>HTTP Status 405</code> with the message <code>Request method 'GET' not supported</code>. But when I changed the method in the <code>@RequestMapping</code> annotation to <code>method=RequestMethod.GET</code> I got my expected page.</p>
  
  <p>Why did this happen?</p>