I have built a simple service in Spring:
@RequestMapping(value = "/list", method = RequestMethod.GET)
public @ResponseBody List<Person> eventList() throws ParseException {
return personDAOImpl.list();
}
When I invoke the corresponding URL, I see a JsonObject list like this:
[{"id":2,"name":"John"},{"id":3,"name":"Jack"},{"id":4,"name":"Sam"}]
This service will be invoked both from a mobile app (and I know how to use a Json response in this case) and from a browser, and so I want that the /list service returns a Json.
By now, if I write the url in a browser (typing localhost:8080/myproject/eventList) I simply obtain the aforementioned Json String displayed on the screen.
How could I obtain a user-friendly interface that shows to the user a more friendly, like if I used a jsp?
ps: I have already used a service that successfully returns a jsp page (using ModelAndView), and that shows a table with the items, but I repeat that I would like to get a json response and than parsing it in a different way depending from the client (web browser or mobile app).
Thank you in advance!