1. 程式人生 > >IDEA丟擲No bean named 'cacheManager' available解決方法

IDEA丟擲No bean named 'cacheManager' available解決方法

(正確的,老師發我的)

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="
http://www.springframework.org/schema/beans"
       xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="
http://www.springframework.org/schema/p

"
       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.xsd
        
http://www.springframework.org/schema/context
        
http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc 
http://www.springframework.org/schema/mvc/spring-mvc.xsd">

 

正確的配置檔案是這個樣子的(複製別人的)


<?xml version="1.0" encoding="UTF-8"?>
<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.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<context:component-scan base-package="controller"/>
<mvc:annotation-driven/>
<bean id="jspViewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/"/>
<property name="suffix" value=".jsp"/>
</bean>
</beans>
---------------------
作者:ripley_csdn
來源:CSDN
原文:https://blog.csdn.net/qq_23184291/article/details/78086398
版權宣告:本文為博主原創文章,轉載請附上博文連結!