web.xml中配置spring的几种方式
文章原址:
http://923080512.iteye.com/blog/1401696
web.xml中配置spring的几种方式
- 博客分类:
- spring
spring有三种启动方式,使用ContextLoaderServlet,ContextLoaderListener和ContextLoaderPlugIn spring3.0及以后版本中已经删除ContextLoaderServlet 和Log4jConfigServlet 可以采用余下两种启动方式ContextLoaderListener和ContextLoaderPlugIn 建议使用ContextLoaderListener 。 N0:1 <!--推荐使用此种方式--> <listener><listener-class>org.springframework.web.context.ContextLoaderListener</listener-class></listener> <!--contextConfigLocation在 ContextLoaderListener类中的默认值是 /WEB-INF/applicationContext.xml--><context-param><param-name>contextConfigLocation</param-name><param-value>/WEB-INF/applicationContext.xml</param-value><!-- <param-value>classpath:applicationContext*.xml</param-value> --></context-param> N0:2 <!--spring3.0之后不再支持此种方式--><servlet><servlet-name>context</servlet-name><servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class><load-on-startup>1</load-on-startup></servlet>-->N0:3<!--要导入org.springframework.web.struts-3.0.5.RELEASE.jar包,在struts2.0及以后版本不支持此种方式加载spring--> <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn"><set-property property="contextConfigLocation" value="/WEB-INF/applicationContext.xml"/></plug-in>
web.xml中配置spring的几种方式相关推荐
- web.config中配置数据库连接的两种方式
在网站开发中,数据库操作是经常要用到的操作,ASP.NET中一般做法是在web.config中配置数据库连接代码,然后在程序中调用数据库连接代码,这样做的好处就是当数据库连接代码需要改变的时候,我们只 ...
- appsettings 连接oracle数据库,web.config中配置数据库连接的两种方式(appSettings 与 connectionStrings)...
[预览] [转载博客]cnblogs.com/sunzhiyue/archive/2011/06/07/2074696.html 在网站开发中,数据库操作是经常要用到的操作,ASP.NET中一般做法是 ...
- 深入理解web.xml中配置/和/*的区别
在用SpringMVC进行web开发的时候,如果将DispathcerServlet对外访问的虚拟路径配置成/时,需要在Spring的配置文件中配置<mvc:default-servlet-ha ...
- SpringMVC在web.xml中配置DispatcherServlet拦截了静态资源访问
如图 在web.xml中配置DispatcherServlet时对于url-pattern的配置方式有以下几种情况: 1.配置为: *.do 或者是 *.action 时,拦截以.do或者.actio ...
- Web.xml中配置监听器Listener导致Tomcat无法启动
Web.xml中配置监听器Listener导致Tomcat无法启动 1.在pom.xml里导入 org.springframework spring-web 5.0.5.RELEASE 版本看你个人的 ...
- 在web.xml中配置过滤器
在web.xml中配置过滤器 <filter> <filter-name>loginFilter</filter-name>//过滤器名称 <filter-c ...
- web.xml中配置web监听器
web.xml中配置web监听器 在web.xml配置监听器,格式如下: <listener><listener-class>类全名</listener-class> ...
- 在配置文件web.xml中配置Struts2的启动信息
在配置文件web.xml中配置Struts2的启动信息: <?xml version="1.0" encoding="UTF-8"?> <we ...
- 服务器启动时Webapp的web.xml中配置的加载顺序
一 1.启动一个WEB项目的时候,WEB容器会去读取它的配置文件web.xml,读取<listener>和<context-param>两个结点. 2.紧急着,容创建一个Ser ...
- web.xml中,spring模块化加载xml方式
1:web.xml中添加监听器. <listener><listener-class>org.springframework.web.context.ContextLoader ...
最新文章
- 博为峰Java技术文章 ——JavaSE Swing FlowLayout布局管理器I
- VS集成opencv编译C++项目遇到的问题
- Gradient Tree Boosting:梯度提升树详解
- linux下安装php扩展模块gettext
- Office PPT如何切换到返回幻灯片
- svn备份遇到的问题
- 注意!这些行为将会影响征信
- MailBee.NET Objects发送电子邮件(SMTP)教程六:创建并发送带有附件的邮件
- mongodb学习笔记之增删改查作指令
- HTML5等先关。。。
- 真正的帅哥没人说帅_“浩南哥”这话你敢信?郑伊健:在香港,没人夸我帅
- I.MX6 dhcpcd 需要指定网卡
- BIOS修改mbr为gpt的步骤
- 一些思考:腾讯股价为何持续都低
- 基因组测序为什么没完没了?
- poi向excel插入图片demo
- anaconda 创建虚拟环境(自己版本)
- python之tkinter Pack使用
- 安利 Access denied for user root @ localhost错误
- 视频教程-手把手实现Java图书管理系统(附源码)-Java
热门文章
- Irrlicht引擎例子说明及中文链接
- Java中PreparedStatement和Statement区别
- mysql数据迁移到sqlserver_技术分享 | 使用OGG实现Oracle到MySQL数据平滑迁移
- 华为harmonyos官方微博账号,华为 EMUI 官方微信和微博更名为 HarmonyOS
- java加密不可逆,32位不可逆加密算法Java实现
- 服务器是怎么响应服务器的细节,我怎样才能得到响应从Web服务器
- python rsi_使用python与rsi进行算法交易
- matlab畸变程度计算,matlab 畸变校正代码
- C/C++[codeup 1962]单词替换
- 深度神经网络 分布式训练 动手学深度学习v2