Skip to content

Resolve MediaType in ContentNegotiatingViewResolver Based on Request Parameter Existence [SPR-7115] #11775

@spring-projects-issues

Description

@spring-projects-issues

Nick Padgett opened SPR-7115 and commented

There are scenarios where the content type for a request should be determined based off of the existence of a request parameter.

For example, when a user requests http://some.tld/events they might get an "application/json" response, but when they request http://some.tld/events?callback=random_method they might get an "text/javascript" response. This is the expected behavior when working with JsonP.

Here's a sample URL from Amazon. Ignore the http response code and look at the http response content types:
http://query.yahooapis.com/v1/public/yql?q=select * from social.connections where owner_guid=me&format=json
http://query.yahooapis.com/v1/public/yql?q=select * from social.connections where owner_guid=me&format=json&callback=cbfunc

More documentation:
http://developer.yahoo.com/yql/guide/response.html


Affects: 3.0.2

Issue Links:

2 votes, 4 watchers

Metadata

Metadata

Assignees

No one assigned

    Labels

    in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions