spring的applicationContext.xml如何自动加载
来源:互联网 发布:淘宝供销平台分销网址 编辑:程序博客网 时间:2024/05/10 05:16
一个web工程自动加载的配置文件只有web.xml,想要加载其他.xml必须在web.xml里面进行配置。
用spring的时候需要一个bean容器来管理所有的bean,所有bean默认是写在applicationContext.xml里的,在web.xml里面是这么设置的,
方式一:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/dispatcherServlet-servlet.xml
</param-value>
</context-param>
<listener>
<listener-class>
org.springframework.web.context.ContextLoaderListener
</listener-class>
</listener>
<context-param>是可选项,如果没有的话就加载applicationContext.xml,也可以用它指定其他配置文件。
方式二:
<servlet>
<servlet-name>context</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
这种没用过。
- spring的applicationContext.xml如何自动加载
- spring 如何加载applicationContext.xml
- Spring 加载xml配置文件的方式 ApplicationContext
- Spring加载配置文件applicationContext.xml的方式
- Spring加载applicationContext.xml的路径问题
- spring 的 applicationcontext.xml
- Spring的applicationContext.xml
- spring 的 applicationcontext.xml
- Spring的applicationContext.xml
- spring的applicationContext.xml
- spring的applicationContext.xml
- Spring中加载ApplicationContext.xml文件的方式
- Spring加载applicationContext.xml的几种方式
- Spring中加载ApplicationContext.xml文件的方式
- Spring中加载ApplicationContext.xml文件的方式【转】
- spring 的启动 之加载文件 applicationContext.xml
- Spring中加载ApplicationContext.xml文件的方式
- Spring加载applicationContext.xml的几种方式
- 筛法求素数;终于找到一篇一看即会的BLOG了;
- 程序八卦:胡子决定编程语言运势
- 矮人DOS工具箱 V4.2 安装及使用
- 学生信息管理系统
- Gigah 史前 0.0.5 版发布
- spring的applicationContext.xml如何自动加载
- Windows Live Messenger 新功能预览
- 初识 Android 资源
- DatagridView 常用功能代码
- ee
- Oacle 表分区入门
- 转:Java学习路线图,专为新手定制的Java学习计划建议
- Convert.ToInt32、(int)和int.Parse三者的区别
- 初识 AndroidManifest.xml 文件