aspose file tools
The moose likes Spring and the fly likes ContentNegotiatingViewResolver Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Reply Bookmark "ContentNegotiatingViewResolver" Watch "ContentNegotiatingViewResolver" New topic
Author

ContentNegotiatingViewResolver

John Eric Hamacher
Ranch Hand

Joined: Apr 25, 2007
Posts: 230
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
 
I agree. Here's the link: http://zeroturnaround.com/jrebel/download
 
subject: ContentNegotiatingViewResolver
 
Similar Threads
CXF: JSON and XML response based on Content-Type
List box initialization through managed bean
406 when trying to resolve xml
JSF backingbean value is null always.
Quartz Cron Expression Help