查找得出的问题是xml头文件的问题
修改头文件后为:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd"
default-lazy-init="true">
在引用json的支持标签
<!-- 支持对象与json的转换 -->
<mvc:annotation-driven />
就可以用上json了
本文介绍了如何通过修改Spring配置文件的XML头文件来解决引入JSON支持的问题。通过正确的声明命名空间和schemaLocation,使得能够使用<mvc:annotation-driven/>标签进行对象与JSON之间的转换。

6543

被折叠的 条评论
为什么被折叠?



