搭建springmvc框架在<mvc:annotation-driven⼀>时 不能创建ApplicationContext 容器 ,去掉这句可以创建

2025-04-29 03:43:56
推荐回答(3个)
回答1:

这是头部的xmlns造成的,里面需要追加:xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="...http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd.."

其中的3.2是版本好,根据你现行的版本更改

回答2:

spring jar的问题,换成3.2以上的jar包

回答3:

测试类用的是spring test么?