title: Mixing Spring MVC with Angular.JS
body: <p>I want to make a Single Page Application with my Spring MVC Backend.
  I've just learnt Angular.js. </p>
  
  <p>I have a left menu consisting of two links. </p>
  
  <p>One makes request to the below controller. This controller makes url forwarding and lists details of something which is filled by the given model attributes.</p>
  
  <pre><code>@RequestMapping(value = "{id}/rev/{rid}/detail", method = RequestMethod.GET)
  public String detail(@PathVariable("id") Project project, @PathVariable("rid") Rev rev, Model model, HttpSession session) {
          User user = ((User) session.getAttribute(CSession.USER));
          model.addAttribute("project", project);
          model.addAttribute("rev", rev);
          model.addAttribute("cont", revContBS.getRevCont(rev, user));
  
          return "template/detail";
  }
  </code></pre>
  
  <p>The other makes an ajax call to the controller which returns JSON.</p>
  
  <pre><code>@RequestMapping(value = "file/{fid}", method = RequestMethod.GET)
  public @ResponseBody String getFile(@PathVariable("fid") FV fv) {
          return repBS.getVerCon(fv);
  }
  </code></pre>
  
  <p>Currently, I have a decoration: the header, the left menu, and the main content area.
  If I click the first link, it will make a full page refresh (because it makes page forwarding and jsp templating)
  If I click the second link, it will only change the main content area.</p>
  
  <p>I want to change the behavior of the first link because it should change only the content area. 
  Is it possible with Angular.JS + Spring MVC? 
  I mean, I will a request a page from the spring mvc. It will template "template/detail.jsp" with given model attributes. But I will put this page into the content area of my ng-app. </p>
  
  <p>Currently, I have problems in following areas:</p>
  
  <ol>
  <li>@RequestMapping(value = "{id}/rev/{rid}/detail", method = RequestMethod.GET) is parametric. I couldn't find a way to make route forwarding parametric.</li>
  <li>I don't know how I should re-serve my "template/detail.jsp" so that it will be placed into the div called ng-view. </li>
  </ol>