spring的相关配置文件--web.xml
2017-11-14 16:31
323 查看
<context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:applicationContext.xml</param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener>
// 当web容器启动时,加载contextConfigLocation对应的applicationCotext.xml文件,将web容器与spring容器整合
<listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener>
// 将web容器和spring整合更亲密,监听web容器http的请求,在spring中才可以得到request,session,globalsession作用域的支持
<servlet> <servlet-name>mvc</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <init-param> <param-name>contextConfigLocation</param-name> <param-value>classpath*:mvc-servlet.xml</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>mvc</servlet-name> <url-pattern>/</url-pattern> </servlet-mapping>
// 是spring前端控制器的实现,解析及渲染视图等
<servlet>
<servlet-name>initServlet</servlet-name>
<servlet-class>com.impay.pushua.servlet.InitServlet</servlet-class>
<load-on-startup>1</load-on-startup>
<
4000
/servlet>// 在web项目启动的时候可以进行必要数据的初始化,如log4j,config.properties等相关信息的初始化
相关文章推荐
- SSM-4 web.xml 及相关spring配置文件
- web.xml文件中配置( listenr, filter,servlet, spring)的加载顺序 研究(转)
- Spring常用的web.xml文件配置
- spring的配置文件在web.xml中加载的方式
- web.xml 文件中一般包括 servlet, spring, filter, listenr的配置。那么他们是按照一个什么顺序加载呢?
- MyEclipse中解决对Spring配置文件XXX.XML不提示的相关设置
- Spring配置文件 在web.xml的几种配置方式
- Spring中,applicationContext.xml 配置文件在web.xml中的配置详解
- 在Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别
- web.xml文件中配置(servlet, spring, filter, listenr)的加载顺序 研究
- 在web.xml中配置spring配置文件的路径
- spring多个配置文件web.xml写法
- web.xml文件中配置(servlet, spring, filter, listenr)的加载顺序(一)
- JavaEE 下面使用Spring 时 web.xml 中ContextLoaderListener的作用及配置,多个配置文件时contextConfigLocation的作用
- 基于注解的Struts2+Spring2.5+Hibernate3.3的Spring 配置文件,struts配置文件,web.xml配置文件的例子
- spring配置文件路径修改后web.xml配置
- web.xml中通过contextConfigLocation的读取spring的配置文件
- web.xml文件中配置(servlet, spring, filter, listenr)的加载顺序
- 在Web.xml中自动扫描Spring的配置文件及resource时classpath*:与classpath:的区别
- [spring]Spring MVC web.xml 配置文件配置