加载spring配置文件的常用三种方法
来源:互联网 发布:听音乐最好的软件 编辑:程序博客网 时间:2024/04/24 17:09
1方法(web.xml)
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
2方法(web.xml)
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml</param-value>
</context-param>
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
</web-app>
3方法在(struts-config.xml)中加载
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext.xml,
/WEB-INF/action-servlet.xml"/>
</plug-in>
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
</web-app>
2方法(web.xml)
<web-app>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/applicationContext-*.xml</param-value>
</context-param>
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
</web-app>
3方法在(struts-config.xml)中加载
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/applicationContext.xml,
/WEB-INF/action-servlet.xml"/>
</plug-in>
- 加载spring配置文件的常用三种方法
- 加载Spring配置文件常用的三种方法
- 加载spring配置文件的常用三种方法
- 加载spring配置文件的常用三种方法
- Web应用中加载Spring配置文件的三种方法
- Spring加载配置文件的三种方式
- Spring加载配置文件的几种方法
- spring 中加载xml配置文件的方法
- Spring 加载配置文件的几个方法
- Spring中加载XML配置文件的方法
- spring加载配置文件三办法
- spring配置文件的加载
- VC 加载自定义形状鼠标的三种常用方法
- jQuery页面加载初始化常用的三种方法
- jQuery页面加载初始化常用的三种方法
- 页面加载初始化常用的三种方法
- jQuery页面加载初始化常用的三种方法
- jQuery页面加载初始化常用的三种方法
- 【原创】MyEclipse从数据库反向生成实体类之Hibernate方式 反向工程
- oracle 之 COMMENT
- Ctypes和NumPy
- 在.NET中对JSON进行序列化与反序列化
- Struts2.2+Spring3.1+Hibernate3.6整合(登录示例及CRUD操作)
- 加载spring配置文件的常用三种方法
- 最新Android开发环境搭建(SDK-r12)自创的哦!
- VC对自定义资源加密解密(AES)
- Weird, but OK
- 字符串的多国语言支持解决方案 Qt篇
- linux ,叫你如何实现脚本自动创建自己专属迷你小linux(一)
- 想家的孩子
- 推荐20个关于CSS3优秀学习资源
- 什么是重型对象: