title: Spring MVC 3 and tiles : allow the controller to change the displayed url
body: <p>Let's say I have a simple search page like this :</p>
  
  <pre><code>&lt;form:form id="productsForm" method="post" modelAttribute="productsFormBean"&gt;
        &lt;form:label path="name"&gt;Name : &lt;/form:label&gt;
        &lt;form:input path="name" /&gt;
        &lt;button id="filterSubmit" type="submit"&gt;Submit&lt;/button&gt;
  &lt;/form:form&gt;
  </code></pre>
  
  <p>A user can enter a name and submit the page, but he can also submit the page without entering anything.</p>
  
  <p>Is it possible to obtain a RESTful url like this :</p>
  
  <ul>
  <li>the user enters the name "xyz" and submits the page : www.mywebpage.com/products/name/xyz/</li>
  <li>the user submits the page without a name : www.mywebpage.com/products/</li>
  </ul>
  
  <p>Here's my controller :</p>
  
  <pre><code>    @RequestMapping(params = "search=true", value = "/**", method = RequestMethod.POST)
      public String searchHandler(@Valid final ProductsFormBean productsFormBean, final Model model) {
          // (...)
          return "productsSearch";
      }
  </code></pre>
  
  <p>If I change the "action" attribute of the form, the url changes. I already achieved that with javascript, by changing the action on the onSubmit event. But it's not a clean solution. Is it possible to achieve that directly in the controller ?</p>