当前位置: 代码迷 >> Web前端 >> web.xml加载spring 时要注意的有关问题
  详细解决方案

web.xml加载spring 时要注意的有关问题

热度:284   发布时间:2012-10-09 10:21:45.0
web.xml加载spring 时要注意的问题

?

 <!-- spring配置  -->
 <listener>  
     	 <listener-class>
             org.springframework.web.context.ContextLoaderListener
         </listener-class>  
 </listener>  	  
  <context-param>  
    	 <param-name>contextConfigLocation</param-name>  
    	 <param-value> 
                classpath:spring/applicationContext-index.xml,   	 	
    	        classpath:spring/DWR-applicationContext.xml,    	 	  	 	
                classpath:applicationContext.xml
?        </param-value>  
  </context-param>  
  <!-- spring配置  end-->
?


???

注意以上代码中的classpath:spring/applicationContext.xml ,这个是在web.xml中最后一个加载的spring文件,这一项目的spring一定要是最全的,包含上面applicationContext.xml所有的内容,否则会出错!

今天发现这个问题,特意发表,如果我说的不对的话,请提出来!

?

  相关解决方案