java - Setting content type in an action -


In Spring MVC 3.0, how can I set the content type of a particular action?

I want to set the action to return the JSON result.

In Spring 3, you usually do not need to or want to set the context type yourself, This is usually unnecessary.

In the case of necessary controllers to return JSON, the easiest way to return JSON is to return an example with your handler method. This will set the content-type for you. Now Spring 3 has built-in support.


Comments

Popular posts from this blog

asp.net - Change the driver in the connection string to a data source in VB.Net -

Getting started consuming web services in a Ruby on Rails 3 application -

objective c - iPhone and it's wireless area -