title: Thymleaf , loading fragments using jQuery
body: <p>I'm checking Thymeleaf with Spring these days. I came across a question on fragments. I've written a Spring controller using <code>@Controller</code> and there is a method <code>@PostMapping</code> below is the method</p>
  
  <pre><code>@PostMapping(value="/xxx/yyy/add",consumes="application/json",produces="application/json")
  public @ResponseBody AModel addMethod(@Valid @RequestBody AModel aModel, BindingResult bindingResult)
  </code></pre>
  
  <p>I've used <code>$.ajax</code> method to POST data to /xxx/yyy/add URL. JSON is mapped ith the AModel object and it works. But I'm returning an <code>AModel</code> object as json response. Not a string mentioning the thymeleaf fragment. The thymeleaf fragment I'm trying to reload contains a table of data. Could someone point me at the right direction of how this could be done? thanks.</p>