Page 1 of 1

Spring Controller or REST api to return a json

Posted: Fri Sep 05, 2014 1:14 pm
by henriqueo
Hi all,

I have a @Controller that return a page, after it loaded a json data must be requested, my question is:
The @Controller should be able to return the Json data or an Api should return this.

Cheers

Re: Spring Controller or REST api to return a json

Posted: Sun Sep 07, 2014 6:33 pm
by RapidTransit
Depending how it is set up, if it's just a plain controller I'd put in the @RequestMapping annotation produces="application/json"

Re: Spring Controller or REST api to return a json

Posted: Sun Sep 14, 2014 10:33 pm
by henriqueo
Thx, I am using @Controller to deal with this