title: Spring MVC Binding Command Object Using Get Request
body: <p>I need to implement a controller that has a command object that is backing a filtering form for a search across multiple entries.</p>
  
  <p>The problem is that the i was asked to do that without using POST request, instead using GET request only, and there before loosing the functionality of the default data binding that springs makes happily for us.</p>
  
  <p>So i tried to implement a method, inside my controller, that looks like this:</p>
  
  <pre><code>@Override
  protected ModelAndView handleRequestInternal(HttpServletRequest request, HttpServletResponse response)
          throws Exception {
      if (isSearchRequest(request)) {
          MyCommandObject myCommandObject = (MyCommandObject) getCommand(request);
          System.out.println(managePositionsForm);
      }
      return super.handleRequestInternal(request, response);
  }
  </code></pre>
  
  <p>But the getCommand returns me a brand new CommandObject with no values, despite that the values are present in the request object (i could retrieve then using the getParameter method of HttpServletRequest). But there isn't any binding.</p>
  
  <p>So the question : </p>
  
  <p>1) Is there any way to archive this?</p>
  
  <p>2) Also is very important, that all the values in the form, are lost and, eventually (if this problem is solved) i will need to "persist" the filters for the users in order to avoid re entering after the first search.</p>
  
  <ul>
  <li>Auto Response : setSessionForm(true); looks like can do the work! (According to javadoc)</li>
  </ul>
  
  <p>Thanks to all!</p>
  
  <p>Greetings</p>
  
  <p>Victor.</p>