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

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -