springmvc 格式化返回日期格式

 1 <mvc:annotation-driven conversion-service="conversionService">
 2         <mvc:message-converters>
 3             <bean class="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
 4                 <property name="objectMapper">
 5                     <bean class="com.fasterxml.jackson.databind.ObjectMapper">
 6                         <property name="dateFormat">
 7                             <bean class="java.text.SimpleDateFormat">
 8                                 <constructor-arg type="java.lang.String" value="yyyy-MM-dd" />
 9                             </bean>
10                         </property>
11                     </bean>
12                 </property>
13                 <property name="supportedMediaTypes">
14                     <list>
15                         <value>text/html;charset=UTF-8</value>
16                         <value>application/json;charset=UTF-8</value>
17                         <value>application/x-www-form-urlencoded</value>
18                     </list>
19                 </property>
20             </bean>
21         </mvc:message-converters>
22     </mvc:annotation-driven>

 

上一篇:jmeter测试教程


下一篇:springmvc返回枚举属性值