關於ssm整合的豆知識<一>

在整合過程中如果遇到:
org.springframework.beans.factory.NoSuchBeanDefinitionException:
No matching bean of type [com.Dao.UserDao] found for dependency:
expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations:
{@org.springframework.beans.factory.annotation.Autowired(required=true)}
那麼可以優先查看你的web.xml監聽器是否被啓動
我的監聽器代碼
<listener>
		<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
	</listener>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value>classpath:applicationContext.xml</param-value>
	</context-param>

添加上後問題解決
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章