在src/main/resources/springmvc-servlet.xml中加入
<!-- 中文注解驱动 --><mvc:annotation-driven><!-- 指定http返回编码格式,不然返回Ajax请求json会出现中文乱码 --><mvc:message-converters><bean class="org.springframework.http.converter.StringHttpMessageConverter"><property name="supportedMediaTypes"><list><value>text/html;charset=UTF-8</value><value>application/json;charset=UTF-8</value><value>*/*;charset=UTF-8</value></list></property></bean></mvc:message-converters></mvc:annotation-driven>