title: Getting POST parameters with Spring
body: <p>I am trying to get the parameter inside a post request in Spring. I have used both the annotation (@RequestParam) and also the getParam method, but none of them work for me. Same code is able to get the parameters when I send them by URL (?input=input). Can anyone help me with this? Here is my code that handles the request:</p>
  
  <pre><code>@RequestMapping(value ="/this",method = RequestMethod.POST)
  public String receiver(HttpServletRequest request,@RequestParam(value="input") String input, Model model){
      String input2 = request.getParameter("input");
      model.addAttribute("input",input);
      return "test";
  }
  </code></pre>
  
  <p>Right now the code uses the annotation to take the input. If I change the model.attribute("input",input) to model.attribute("input",input2) then I would be using the get attribute method. Both work fine when I pass the parameter with the URL but when I pass the parameter using POST form none of them work. 
  And here is the view. it just prints the input parameter from the model:</p>
  
  <pre><code>&lt;!DOCTYPE http&gt;
  &lt;html&gt;
  &lt;body&gt;
  test
  ${input}
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>