Maven项目中调用ResponseBody注解问题

在代码中调用ResponseBody注解进行jasn注入,引入jackson包后出现问题,Request processing failed; nested exception is java.lang.IllegalArgumentException: No converter found for return value of type: class com.pawn.ssm.bean.Msg,删掉导入的jackson包依然报这个错误,错误缘由,导入的jackson包未起做用,解决方法,在mvc配置文件中添加对<mvc:annotation-driven />的注解,添加内容为html

1         <mvc:message-converters>
2             <bean class="org.springframework.http.converter.StringHttpMessageConverter">
3                 <property name="supportedMediaTypes">
4                     <list>
5                         <value>text/plain;charset=UTF-8</value>
6                     </list>
7                 </property>
8             </bean>
9         </mvc:message-converters>

问题得以解决,java

参考资料https://www.cnblogs.com/shuo1208/p/5552134.htmlspring

相关文章
相关标签/搜索