Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / 基于S2SH框架的项目—web.xml文件配置

为了Spring和Strust2的完美结合,需要在web.xml文件加入如下几部分代码1、Spring配置文件默认情况下,Spring配置文件为applicationContext.xml,该文件保存在src目录下。  <!-- 用来定位Spring XML文件的上下文配置 --> 
 <context-param> 
   <param-name>contextConfigLocation</param-name> 
   <param-value>classpath:applicationContext.xml</param-value> 
 </context-param>2、配置Spring监听器<listener>
     <listener-class>
   org.springframework.web.context.ContextLoaderListener
     </listener-class>
</listener>