0

I have to develop an application which takes XML reports stored in File System parse it and put it into database and display the reports by querying the database in various MIME types(XML,JSON,RSS and HTML). So what I have done till now is parsed the XML reports in the file system ,setup schema for database in MongoDB,put data in database using Spring-data and also managed to have a web service which shows rough draft of reports in XML,JSON and RSS feed.Now I want to display the reports in HTML as well and my supervisor suggested me to use Backbone.js to dispaly it in HTML format by calling the web service.Kindly advice me to choose b/w Backbone.js or write another Spring MVC web service which generates reports in HTML.

Thanks in advance Swaraj

2
  • Are these actually exclusive choices? I would think you should still use Spring MVC for the application / web service since you are already working with Spring Data. Backbone.js might be helpful for the front end implementation .. but is possibly overkill if you just want to generate some simple HTML reports.
    – Stennie
    Aug 11, 2012 at 6:33
  • @Stennie Thanks for the reply but what would be the possible solution then. Aug 13, 2012 at 13:32

1 Answer 1

0

What you are asking are two different things and choosing between them. You have to know what your overall objective is with the webapp is and what framework is best for it.

Short answer, Spring MVC integrates with Dojo.js right out of the box, which might do what you need to do, but since your supervisor is suggesting otherwise your options are:

  • Use Spring MVC to construct and display the data in the HTML using what ever render of your choice.

Or

  • Build out your Spring MVC wepapp API so that you can use a JavaScript MVC framework, such as Backbone.js or one of the many others (see TODOMVC for samples), to interact with your spring controllers.

Option 1 might be easy enough, used in conjunction with JavaScript or jQuery and plugins

Option 2 would be good if your webapp is complex and will be mostly a SPA (single page app) that utilizes a lot of JavaScript and you want a way to organize your js code better. See JavaScript MVC diagram for an example of how it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.