title: Bootstrapping backbone.js models with java server
body: <p>I'm planning a single page webapp with backbone.js and a java backend running jersey. I am interested in bootstrapping model data into the page on the initial load to prevent additional ajax requests, as suggested by the backbone.js documentation:</p>
  
  <blockquote>
    <p>When your app first loads, it's common to have a set of initial models that you know you're going to need, in order to render the page. Instead of firing an extra AJAX request to fetch them, a nicer pattern is to have their data already bootstrapped into the page.</p>
  </blockquote>
  
  <p>Examples of what I think I need to do are given at <a href="http://ricostacruz.com/backbone-patterns/#bootstrapping_data" rel="nofollow noreferrer">backbone-patterns</a> for ruby and php, but I'm not quite connecting the dots with how this would work in java. Do I need to use a templating library such as mustache.java and preprocess the page before it's served? Could someone give me an example of how that would look?</p>
  
  <p>Thanks, Mark</p>