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:
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.
Examples of what I think I need to do are given at backbone-patterns 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?
Thanks, Mark