Skip to content

Commit 50846e3

Browse files
committed
Update reference
1 parent 801658d commit 50846e3

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/asciidoc/index.adoc

+10-5
Original file line numberDiff line numberDiff line change
@@ -1063,8 +1063,7 @@ method has been added.
10631063
summary vs. detail page). This is also supported with View-based rendering by
10641064
adding the serialization view type as a model attribute under a special key.
10651065
See <<mvc-ann-jsonview>> for details.
1066-
* JSONP is now supported with Jackson, both for <<mvc-ann-jsonp,response body methods>> and
1067-
<<view-json-mapping,`View`-based rendering>>.
1066+
* JSONP is now supported with Jackson. See <<mvc-ann-jsonp>>.
10681067
* A new lifecycle option is available for intercepting `@ResponseBody` and `ResponseEntity`
10691068
methods just after the controller method returns and before the response is written.
10701069
To take advantage declare an `@ControllerAdvice` bean that implements `ResponseBodyAdvice`.
@@ -31716,8 +31715,10 @@ to the model:
3171631715
[[mvc-ann-jsonp]]
3171731716
===== Jackson JSONP Support
3171831717

31719-
In order to enable http://en.wikipedia.org/wiki/JSONP[JSONP] support for your response
31720-
body methods, declare an `@ControllerAdvice` as shown below:
31718+
In order to enable http://en.wikipedia.org/wiki/JSONP[JSONP] support for `@ResponseBody`
31719+
and `ResponseEntity` methods, declare an `@ControllerAdvice` bean that extends
31720+
`AbstractJsonpResponseBodyAdvice` as shown below where the constructor argument indicates
31721+
the JSONP query parameter name(s):
3172131722

3172231723
[source,java,indent=0]
3172331724
[subs="verbatim,quotes"]
@@ -31731,6 +31732,10 @@ body methods, declare an `@ControllerAdvice` as shown below:
3173131732
}
3173231733
----
3173331734

31735+
For controllers relying on view resolution, JSONP is automatically enabled when the
31736+
request has a query parameter named `jsonp` or `callback`. Those names can be
31737+
customized through `jsonpParameterNames` property.
31738+
3173431739

3173531740
[[mvc-ann-async]]
3173631741
==== Asynchronous Request Processing
@@ -37025,7 +37030,7 @@ serializers/deserializers need to be provided for specific types.
3702537030

3702637031
http://en.wikipedia.org/wiki/JSONP[JSONP] is supported and automatically enabled when
3702737032
the request has a query parameter named `jsonp` or `callback`. The JSONP query parameter
37028-
name(s) could be customized thanks to the `JsonpParameterNames` property.
37033+
name(s) could be customized through the `jsonpParameterNames` property.
3702937034

3703037035

3703137036

0 commit comments

Comments
 (0)