错误如下:
org.springframework.beans.factory.BeanDefinitionStoreException: IOException parsing XML document from resource [/WEB-INF/applicationContext.xml] of ServletContext; nested exception is java.io.FileNotFoundException: Could not open resource [/WEB-INF/applicationContext.xml] of ServletContext
java.io.FileNotFoundException: Could not open resource [/WEB-INF/applicationContext.xml] of ServletContext
加载spring的配置文件时在默认位置/WEB-INF/下找不到applicationContext.xml文件,看了下,myeclipse自动生成的applicationContext.xml放在/WEB-INF/classes下,难怪找不到,终于发现问题了,下面在web.xml中做如下配置即可解决:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/classes/applicationContext.xml</param-value>
</context-param>
分享到:
相关推荐
Error creating bean with name 'org.springframework.web.servlet.handler.SimpleUrlHandlerMapping#0' defined in ServletContext resource [/WEB-INF/springMVC-servlet.xml]: Initialization of bean failed;...
javax.servlet.ServletContext.class javax.servlet.RequestDispatcher.class javax.servlet.Servlet.class javax.servlet.ServletException.class javax.servlet.ServletRequest.class javax.servlet.Servlet...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Instantiation of bean failed;...
<param-value>/WEB-INF/view/</param-value> </init-param> <init-param> <param-name>suffix</param-name> <param-value>.jsp</param-value> </init-param> </servlet> <servlet-mapping> <servlet-name...
简单的说,在web容器中,通过ServletContext为Spring的IOC容器提供宿主环境,对应的建立起一个IOC容器的体系。其中,首先需要建立的是根上下文,这个上下文持有的对象可以有业务对象,数据存取对象,资源,事物管理...
- Loading XML bean definitions from ServletContext resource [/WEB-INF/dispatcher.xml] - JSR-330 'javax.inject.Named' annotation found and supported for component scanning - JSR-330 'javax.inject....
org.springframework.web.context.support.ServletContextResource.class org.springframework.web.context.support.ServletContextResourceLoader.class org.springframework.web.context.support....
ServletContext读取web应用中的资源文件
Error registering bean with name 'myDataSource' defined in ServletContext resource 下载commons-pool-1.x.jar,commons-dbcp.jar文件,导入lib目录下
application.getRequestDispatcher("/WEB-INF/front/success.jsp").forward(req, resp); return; } req.setAttribute("err", listErr); req.getRequestDispatcher("/err.jsp").forward(req, resp);...
Ssh获取ServletContext 只需要更改struts-config action中的type就可以了ru :type="com.uo.spring.SpringDelegatingActionProxy" 大家有什么疑问可以直接去我的blog查看...《[正解]Ssh获取ServletContext》
A filter is an object that performs filtering tasks on either the request to a resource (a servlet or static content), or on the response from a resource, or both. Filters perform filtering in the ...
Spring Web Flow 2.0 入门 本教程分析了 Spring Web Flow 2.0 的技术要点,并且通过创建一个示例应用程序,展示了 Spring Web Flow 2.0 的基本知识。 开始之前 关于本教程 本教程通过一个简化的购物车应用,介绍了...
主要介绍了Spring实战之ServletContextResource访问资源文件,结合实例形式分析了spring使用ServletContextResource读取与遍历资源文件相关操作技巧,需要的朋友可以参考下
Servlet生命周期,及servlet相关知识点的总结。
NULL 博文链接:https://onway417.iteye.com/blog/2194540
ServletContext代码,开发工具 Myeclipse
接收消息:从ServletContext中获取消息,如果不为空则输出消息。 5. 在线人员列表显示功能的实现 将登录进系统的用户与其对应的session存储到一个userMap中,然后显示出来 6. 踢人功能的实现 接收前台传来的...
这是servlet中ServletContext的应用实例,主要就是添加属性和读取属性。
ServletContext与ServletConfig关系