no bean named “userDao” is defined

这一生的挚爱 提交于 2019-12-02 07:28:34

classpath*:/servlet-context.xml will load every servlet-context.xml resource from the root of your application's classpath.

/myproject/WebContent/WEB-INF/spring/appServlet/servlet-context.xml, however, isn't on the classpath root at all, and so Spring will ignore your file and build an empty context.

Try moving servlet-context.xml to be directly under WEB-INF/classes (i.e. to WEB-INF/classes/servlet-context.xml).

Alternatively, move it to WEB-INF/classes/spring/appServlet/servlet-context.xml, and change your code to classpath*:/spring/appServlet/servlet-context.xml

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!