Skip to content

Commit 64db939

Browse files
committed
Javadoc update for content negotiation
Closes gh-23409
1 parent 3d83f86 commit 64db939

File tree

2 files changed

+48
-39
lines changed

2 files changed

+48
-39
lines changed

spring-web/src/main/java/org/springframework/web/accept/ContentNegotiationManagerFactoryBean.java

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -36,49 +36,55 @@
3636

3737
/**
3838
* Factory to create a {@code ContentNegotiationManager} and configure it with
39-
* one or more {@link ContentNegotiationStrategy} instances.
39+
* {@link ContentNegotiationStrategy} instances.
4040
*
41-
* <p>As of 5.0 you can set the exact strategies to use via
42-
* {@link #setStrategies(List)}.
43-
*
44-
* <p>As an alternative you can also rely on the set of defaults described below
45-
* which can be turned on or off or customized through the methods of this
46-
* builder:
41+
* <p>This factory offers properties that in turn result in configuring the
42+
* underlying strategies. The table below shows the property names, their
43+
* default settings, as well as the strategies that they help to configure:
4744
*
4845
* <table>
4946
* <tr>
5047
* <th>Property Setter</th>
48+
* <th>Default Value</th>
5149
* <th>Underlying Strategy</th>
52-
* <th>Default Setting</th>
50+
* <th>Enabled Or Not</th>
5351
* </tr>
5452
* <tr>
55-
* <td>{@link #setFavorPathExtension}</td>
56-
* <td>{@link PathExtensionContentNegotiationStrategy Path Extension strategy}</td>
57-
* <td>On</td>
53+
* <td>{@link #setFavorPathExtension favorPathExtension}</td>
54+
* <td>true</td>
55+
* <td>{@link PathExtensionContentNegotiationStrategy}</td>
56+
* <td>Enabled</td>
5857
* </tr>
5958
* <tr>
6059
* <td>{@link #setFavorParameter favorParameter}</td>
61-
* <td>{@link ParameterContentNegotiationStrategy Parameter strategy}</td>
60+
* <td>false</td>
61+
* <td>{@link ParameterContentNegotiationStrategy}</td>
6262
* <td>Off</td>
6363
* </tr>
6464
* <tr>
6565
* <td>{@link #setIgnoreAcceptHeader ignoreAcceptHeader}</td>
66-
* <td>{@link HeaderContentNegotiationStrategy Header strategy}</td>
67-
* <td>On</td>
66+
* <td>false</td>
67+
* <td>{@link HeaderContentNegotiationStrategy}</td>
68+
* <td>Enabled</td>
6869
* </tr>
6970
* <tr>
7071
* <td>{@link #setDefaultContentType defaultContentType}</td>
71-
* <td>{@link FixedContentNegotiationStrategy Fixed content strategy}</td>
72-
* <td>Not set</td>
72+
* <td>null</td>
73+
* <td>{@link FixedContentNegotiationStrategy}</td>
74+
* <td>Off</td>
7375
* </tr>
7476
* <tr>
7577
* <td>{@link #setDefaultContentTypeStrategy defaultContentTypeStrategy}</td>
78+
* <td>null</td>
7679
* <td>{@link ContentNegotiationStrategy}</td>
77-
* <td>Not set</td>
80+
* <td>Off</td>
7881
* </tr>
7982
* </table>
8083
*
81-
* <strong>Note:</strong> if you must use URL-based content type resolution,
84+
* <p>As of 5.0 you can set the exact strategies to use via
85+
* {@link #setStrategies(List)}.
86+
*
87+
* <p><strong>Note:</strong> if you must use URL-based content type resolution,
8288
* the use of a query parameter is simpler and preferable to the use of a path
8389
* extension since the latter can cause issues with URI variables, path
8490
* parameters, and URI decoding. Consider setting {@link #setFavorPathExtension}

spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/ContentNegotiationConfigurer.java

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2018 the original author or authors.
2+
* Copyright 2002-2019 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -38,50 +38,53 @@
3838
* Creates a {@code ContentNegotiationManager} and configures it with
3939
* one or more {@link ContentNegotiationStrategy} instances.
4040
*
41-
* <p>As of 5.0 you can set the exact strategies to use via
42-
* {@link #strategies(List)}.
43-
*
44-
* <p>As an alternative you can also rely on the set of defaults described below
45-
* which can be turned on or off or customized through the methods of this
46-
* builder:
41+
* <p>This factory offers properties that in turn result in configuring the
42+
* underlying strategies. The table below shows the property names, their
43+
* default settings, as well as the strategies that they help to configure:
4744
*
4845
* <table>
4946
* <tr>
50-
* <th>Configurer Property</th>
47+
* <th>Property Setter</th>
48+
* <th>Default Value</th>
5149
* <th>Underlying Strategy</th>
52-
* <th>Default Setting</th>
50+
* <th>Enabled Or Not</th>
5351
* </tr>
5452
* <tr>
5553
* <td>{@link #favorPathExtension}</td>
56-
* <td>{@link PathExtensionContentNegotiationStrategy Path Extension strategy}</td>
57-
* <td>On</td>
54+
* <td>true</td>
55+
* <td>{@link PathExtensionContentNegotiationStrategy}</td>
56+
* <td>Enabled</td>
5857
* </tr>
5958
* <tr>
6059
* <td>{@link #favorParameter}</td>
61-
* <td>{@link ParameterContentNegotiationStrategy Parameter strategy}</td>
60+
* <td>false</td>
61+
* <td>{@link ParameterContentNegotiationStrategy}</td>
6262
* <td>Off</td>
6363
* </tr>
6464
* <tr>
6565
* <td>{@link #ignoreAcceptHeader}</td>
66-
* <td>{@link HeaderContentNegotiationStrategy Header strategy}</td>
67-
* <td>On</td>
66+
* <td>false</td>
67+
* <td>{@link HeaderContentNegotiationStrategy}</td>
68+
* <td>Enabled</td>
6869
* </tr>
6970
* <tr>
7071
* <td>{@link #defaultContentType}</td>
71-
* <td>{@link FixedContentNegotiationStrategy Fixed content strategy}</td>
72-
* <td>Not set</td>
72+
* <td>null</td>
73+
* <td>{@link FixedContentNegotiationStrategy}</td>
74+
* <td>Off</td>
7375
* </tr>
7476
* <tr>
7577
* <td>{@link #defaultContentTypeStrategy}</td>
78+
* <td>null</td>
7679
* <td>{@link ContentNegotiationStrategy}</td>
77-
* <td>Not set</td>
80+
* <td>Off</td>
7881
* </tr>
7982
* </table>
8083
*
81-
* <p>The order in which strategies are configured is fixed. You can only turn
82-
* them on or off.
84+
* <p>As of 5.0 you can set the exact strategies to use via
85+
* {@link #strategies(List)}.
8386
*
84-
* <strong>Note:</strong> if you must use URL-based content type resolution,
87+
* <p><strong>Note:</strong> if you must use URL-based content type resolution,
8588
* the use of a query parameter is simpler and preferable to the use of a path
8689
* extension since the latter can cause issues with URI variables, path
8790
* parameters, and URI decoding. Consider setting {@link #favorPathExtension}

0 commit comments

Comments
 (0)