-
Nov 24th, 2009, 05:50 PM
#1
Does roo generated controllers support Content Negotiation for REST?
In my project, RESTful urls need to handle different types of response (html/txt, application/xml & application/json for my case). Does ROO generated project give this functionality already?
Regards,
Jiang Zhu
-
Nov 24th, 2009, 11:39 PM
#2
Jiang,
What you are looking for is Springs new ContentNegotiatingViewResolver which allows you to configure the document types. It is documented here http://tinyurl.com/kpexuu and allows you to render views in XML, JSON, ATOM and a couple more.
This feature is not currently enabled by default in Roo managed applications but can be easily added to the webmvc-config.xml file. Keep in mind when you setup JSON with the Jackson library you will need to deal with cyclic references.
HTH,
Stefan
-
Nov 25th, 2009, 01:12 AM
#3
Stefan,
Thanks for your reply, the info is very useful.
Regards,
Jiang Zhu
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules