首先,這個標簽是3.0后引入的;
如果3.0還不能解析,則是xml配置文件mvc頭沒有引入,在*-servlet.xml頭信息里加入如下:
xmlns:mvc="http://www.springframework.org/schema/mvc"
http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
另外在spring中返回json時,需要在controller前配置<mvc:annotation-driven/>,
還要引入jackson-all-1.8.8.jar包,或者低版本的2個jackson包