Add support for content negotiation based on a request parameter value [SPR-5870] #10539
Labels
in: web
Issues in web modules (web, webmvc, webflux, websocket)
type: enhancement
A general enhancement
Milestone
Rostislav Hristov opened SPR-5870 and commented
Content negotiation based on a request parameter can be a nice addition to the framework. Such a capability is already available in Grails (http://grails.org/doc/1.0.x/guide/single.html#6.8%20Content%20Negotiation). I was able to implement it and use it by extending the ContentNegotiatingViewResolver but it will be great if it can become a part of the framework.
Such a feature is required in a scenario where you have an HTML FORM which allows you to select the format you want to receive after submitting it. The only way to implement such a form unobtrusively (without JavaScript) is to use a SELECT dropdown defining the requested media extension. Without JavaScript you cannot change the FORM action address or the request header. Even with JavaScript support it's much more easier to use a request parameter than any other implementation.
As a result of this improvement the content negotiation will be available in the following scenarious:
/book/list.xml
/book/list?format=xml
/book/list (with proper Accept header)
Affects: 3.0 M3
Attachments:
1 votes, 1 watchers
The text was updated successfully, but these errors were encountered: