spring配置文件中加入以下代码
<mvc:annotation-driven>
<mvc:message-converters register-defaults="true">
<beanclass="org.springframework.http.converter.StringHttpMessageConverter">
<constructor-arg value="UTF-8"/>
</bean>
<beanclass="org.springframework.http.converter.json.MappingJackson2HttpMessageConverter">
<property name="objectMapper">
<beanclass="org.springframework.http.converter.json.Jackson2ObjectMapperFactoryBean">
<property name="failOnEmptyBeans" value="false"/>
</bean>
</property>
</bean>
</mvc:message-converters>
</mvc:annotation-driven>