|
55 | 55 | * <pre class="code"> |
56 | 56 | * <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter"> |
57 | 57 | * <property name="objectMapper"> |
58 | | - * <bean class="org.springframework.web.context.support.Jackson2ObjectMapperFactoryBean" |
| 58 | + * <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean" |
59 | 59 | * p:autoDetectFields="false" |
60 | 60 | * p:autoDetectGettersSetters="false" |
61 | 61 | * p:annotationIntrospector-ref="jaxbAnnotationIntrospector" /> |
|
68 | 68 | * <pre class="code"> |
69 | 69 | * <bean class="org.springframework.web.servlet.view.json.MappingJackson2JsonView"> |
70 | 70 | * <property name="objectMapper"> |
71 | | - * <bean class="org.springframework.web.context.support.Jackson2ObjectMapperFactoryBean" |
| 71 | + * <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean" |
72 | 72 | * p:failOnEmptyBeans="false" |
73 | 73 | * p:indentOutput="true"> |
74 | 74 | * <property name="serializers"> |
|
81 | 81 | * </bean> |
82 | 82 | * </pre> |
83 | 83 | * |
84 | | - * <p>In case there are no specific setters provided (for some rarely used |
85 | | - * options), you can still use the more general methods |
86 | | - * {@link #setFeaturesToEnable(Object[])} and {@link #setFeaturesToDisable(Object[])}. |
| 84 | + * <p>In case there are no specific setters provided (for some rarely used options), |
| 85 | + * you can still use the more general methods {@link #setFeaturesToEnable} and |
| 86 | + * {@link #setFeaturesToDisable}. |
87 | 87 | * |
88 | 88 | * <pre class="code"> |
89 | | - * <bean class="org.springframework.web.context.support.Jackson2ObjectMapperFactoryBean"> |
| 89 | + * <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean"> |
90 | 90 | * <property name="featuresToEnable"> |
91 | 91 | * <array> |
92 | 92 | * <util:constant static-field="com.fasterxml.jackson.databind.SerializationFeature$WRAP_ROOT_VALUE"/> |
|
101 | 101 | * </bean> |
102 | 102 | * </pre> |
103 | 103 | * |
104 | | - * In case you want to configure Jackson's {@link ObjectMapper} with a {@link Module}, you |
105 | | - * can register Modules using {@link #setModules(java.util.List)} |
| 104 | + * <p>In case you want to configure Jackson's {@link ObjectMapper} with a custom {@link Module}, |
| 105 | + * you can register one or more such Modules by class name via {@link #setModulesToInstall}: |
106 | 106 | * |
107 | 107 | * <pre class="code"> |
108 | | - * <bean class="org.springframework.web.context.support.Jackson2ObjectMapperFactoryBean"> |
109 | | - * <property name="modules"> |
110 | | - * <list> |
111 | | - * <bean class="org.example.jackson.module.MySampleModule"/> |
112 | | - * </list> |
113 | | - * </property> |
114 | | - * </bean> |
| 108 | + * <bean class="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean"> |
| 109 | + * <property name="modulesToInstall" value="myapp.jackson.MySampleModule,myapp.jackson.MyOtherModule"/> |
| 110 | + * </bean |
115 | 111 | * </pre> |
116 | 112 | * |
| 113 | + * Note that Jackson's JSR-310 and Joda-Time support modules will be registered automatically |
| 114 | + * when available (and when Java 8 and Joda-Time themselves are available, respectively). |
| 115 | + * |
117 | 116 | * <p>Tested against Jackson 2.2 and 2.3; compatible with Jackson 2.0 and higher. |
118 | 117 | * |
119 | 118 | * @author <a href="mailto:[email protected]">Dmitry Katsubo</a> |
|
0 commit comments