Skip to content

Add JSONP support to MappingJackson2MessageConverter [SPR-9899] #14532

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Oct 20, 2012 · 2 comments
Closed
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Oct 20, 2012

Johan Sjöberg opened SPR-9899 and commented

To implement a JSONP (padded json) HttpMessageConverter a parameter from the Servlet request map is necessary (e.g., ?callback=foo) which affects the produced JSON output.

E.g., if a regular JSON response is {json}, then JSONP for value foo is

foo({json});

One option would be the add the HttpServletRequest or similar to:

HttpMesageConverter.write(T t, MediaType contentType, HttpOutputMessage outputMessage)


Affects: 4.0.5

Issue Links:

@spring-projects-issues
Copy link
Collaborator Author

spring-projects-issues commented May 20, 2014

Rossen Stoyanchev commented

Modified title (was "Add Request parameter to HttpMessageConverter.write(..)") to reflect how we'll actually address the underlying requirement for JSONP formatting. The enabler for this is #15486.

@spring-projects-issues
Copy link
Collaborator Author

Rossen Stoyanchev commented

See commit 1338d4 and also this example test with JSONP advice.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants