-
Sep 18th, 2012, 05:16 AM
#1
PUT requests failing from RestTemplate to Roo generate JSON restful web service
I've built a very simple restful JSON web service using the Roo shell that comes with STS Version: 3.0.0.201208090952-RELEASE.
I've configured a client using the RestTemplate with a MappingJacksonHttpMessageConverter and this is working nicely for GETs, POSTs and DELETEs.
The issue I'm hitting is with PUT operations, they do not supply a "ReponseType" to the HttpEntityRequestCallback and so default "Accept" headers are used for the the PUT request.
Alas the MVC Web + JSON web service I built with Roo then routes the call to the HTML controller and not the JSON controller.
As Roo is in charge of the controllers I am relying on the request mappings to "just work".
- Should I be trying to force the RestTemplate to set "Accept: application/json" for PUTs? (If so, how?)
- Has Roo got the controller request mapping wrong? It is currently set to "@RequestMapping(method = RequestMethod.PUT, headers = "Accept=application/json")" for the json controller.
- Or maybe its just me that's at fault ...
Any advice welcome!
Thanks.
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