Announcement Announcement Module
No announcement yet.
Response and Request formats. Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Response and Request formats.


    First,, I am a new to Spring and this is my first attempt to write a REST based application using Spring.

    I am planning to use Json both request parameters and in responses. This brings me to two questions.

    1. Is there a way to set produces="application/json" as default for all my mvc controllers.
    2. If anyone sends a request with others formats than application/json,,, I would like to return a error message. If the client set the Accept header to application/xml,,, my spring still returns json,, with no futher infomation.