This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

ContentNegotiatingViewResolver  RSS feed

 
John Eric Hamacher
Ranch Hand
Posts: 230
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello:

I have a RESTful web service in which I want to give the client the option of receiving either XML or JSON by specifying the extension on the URL:






If I send:

http://localhost::9081/SIMS_Student_Location_Confirm/SIMS/get/2828/1234567890.json

I only get only JSON back if I specify the Accept header as application/json. If I specify both text.xml and application/json in the header, I always get XML back, no matter what extension I use. I'd like the extension to determine the format of the output. I've been trying to follow the new Spring in Action book but there is something missing in the text.

Thanks
eric
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!