title: Spring MVC - Model Attribute parameter not refreshing on GET
body: <p>I've got a SpringController getting a RequestParameter named 'start' for search/hibernate pagination purposes. If the parameter is null, just start from zero and render a JSP with a JavaScript var 'start = {start + 10}', so if the user clicks on the "next 10" button, the controller gets a 'start = 10'. Then, the controller should render a JSP with 'start = {start + 10} = 20, but it remains 10 no matter how many times I go through the controller.
  I've made the addition both in server and client side. Same thing happens: Nothing.
  Here's the controller method:</p>
  
  <pre><code>@RequestMapping(value = "/customers", method = RequestMethod.GET)
  public String customersView(@RequestParam(value = "start", required = false) Integer start, ModelMap model) {
      if (start == null || start &lt;= 0) start = 0;
  
      List&lt;Customer&gt; customers = customerService.findAllCustomers(start, pagesize);      
      CustomersForm customersForm = new CustomersForm();
      customersForm.setCustomers(customers);
      start += 10; // I can see a "20" here, actually.
      model.clear();
      model.addAttribute("customersform", customersForm);
      model.addAttribute("start", start); //This should render a "20" on client side on the first call, but it doesn't.
      return "customers";
  }
  </code></pre>
  
  <p>This is the relevant part of the JSP:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  jq(document).ready(function() {
      jq("#next_20").click(function() {
          var st = "${start}";  //This gets set OK only first time, i.e., a "10" is rendered.
          jq.get("customers",
          {
              start: st
          });
      });
  });
  </code></pre>
  
  <p></p>
  
  <p>OK now, I've also added these lines to my servlet-context, because I suspect it is related to some caching some part (browser, Tomcat) is doing...:</p>
  
  <pre><code>&lt;!-- Disable web cache for GET requests --&gt;
  &lt;mvc:interceptors&gt;
      &lt;bean id="webContentInterceptor"
          class="org.springframework.web.servlet.mvc.WebContentInterceptor"&gt;
          &lt;property name="cacheSeconds" value="0" /&gt;
          &lt;property name="useExpiresHeader" value="true" /&gt;
          &lt;property name="useCacheControlHeader" value="true" /&gt;
          &lt;property name="useCacheControlNoStore" value="true" /&gt;
      &lt;/bean&gt;
  &lt;/mvc:interceptors&gt;
  </code></pre>
  
  <p>And that's it. When I click on the "next_20" button, my controller is called, a "start" parameter is passed (10) and should be replaced in the model with a "20", but the rendered page has still a "10" there.</p>
  
  <p>What am I doing wrong?</p>
  
  <p>Cheers</p>