Skip to content

Support JSON-P Callback parameters in MappingJacksonJsonView [SPR-8346] #12994

@spring-projects-issues

Description

@spring-projects-issues

Ted Pennings opened SPR-8346 and commented

The MappingJacksonJsonView class should support some sort of JSONP callback.
Requests of the form http://host/path/resource.json?callback=fnx should return the response in the following format:

fnx({obj:val, obj2, val});

The callback function value should be a query parameter from the request so the client can easily modify it on individual requests.

This is very useful for cross-domain Ajax/REST requests in a browser. It can be easily added by extending MappingJacksonJsonView, but it would be awesome if Spring MVC supported it out of he box.


Affects: 4.0.5

Issue Links:

Referenced from: commits 5dc27ee

3 votes, 7 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions