spring的三种加载方式

1、ContextLoaderServlet

 <servlet>
    <servlet-name>springInitServlet</servlet-name>
    <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>


 

2、ContextLoaderListener

 <listener>
 <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
 </listener>

3、ContextLoaderPlugIn

在struts中使用插件的方式调用

<struts-config>
  <form-beans>
   
  </form-beans>
  <action-mappings>
    
  </action-mappings>
  
    < message-resources parameter="ApplicationResources" /> 
  <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
	<set-property property="contextConfigLocation" value="/WEB-INF/applicationContext-action-file.xml" />
  </plug-in> 
  </struts-config>
posted @ 2010-03-01 17:30  phpzxh  阅读(764)  评论(0编辑  收藏  举报