Well my concern goes like this,
The basics of Restful API's say that whenever you use CRUD operations you need to use GET for Create, POST for Save, PUT for Edit and DELETE for Delete.
Now suppose a programmer is writing CRUD Operations methods in Controller and wants output as JSON Strings for that particular URI then he has to return JSON.
But incase of Spring MVC we could return ModelAndView object which in my case when i see through a browser gives an HTML Output for a sample CRUD URI.
How could both the ways be achieved such that i could return a ModelAndView for binding variables onto the
JSP Elements and also when the same URI is accessed then it would return a JSON/XML response.
i was reading the same on a very useful blog (I''m not sure whether pasting external links are allowed here.)
http://www.javatechtipssharedbygaurav.com/2013/04/rest-web-service-with-crud-operations.html
The motive here is achieved but i failed to understand the logic behind it.
Also what are the corresponding Json frameworks packages like we have for XML in javax.xml.bing.annotations
Thank You !