Steps to return json view from Spring controller?

You can just let your method return the JSON String if you use the ResponseBody annotation and use one of the methods listed in the answers to my previous question.

You can just let your method return the JSON String if you use the @ResponseBody annotation and use one of the methods listed in the answers to my previous question: In Spring MVC, how can I set the mime type header when using @ResponseBody.

Sean Patrick Floyd :I saw your solution how can I do samething without annotations. – user581805 Jan 24 at 12:11 Very excellent solution,i will try this solution without annotations – user581805 Jan 24 at 12:55 Sean Patrick Floyd :i didn't see CharacterStreams,MediaType classes in Spring 2.5,do I need to download any jars to implement your solution. – user581805 Jan 24 at 16:16 No, my guess is that these types have been added in Spring 3.x.(I've never tried MVC in 2.5) – Sean Patrick Floyd 05 Jan7 at 16:19 Thanks Sean,MediaType is from Spring 3.0,there I will mention application/json.

But CharStreams and Closeables api is from google code. IS there any way to write same functionlity with native java code. – user581805 Jan 24 at 17:13.

I'm a total newbie but I've read some where that when you don't specify any logical view mapping for a controller and you return a model map from a handler method (@Controller, @RequestMapping) it should transform the model object to json and return it.

1 Please use real language ("u" is not appropriate) – Sean Patrick Floyd Jan 24 at 11:45.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions