(1)使用Struts插件

         在struts-config.xml中
       

  <plug-in className="org.springframework.web.struts.ContextLoaderPlugin">
    
<set-property property="contextConfigLocation"
                  value
="applicationContext.xml"/>
  
</plug-in>

(2)在web.xml中使用Listener

 

<context-param>
  
<param-name>contextConfigLocation</param-name>
        
<param-value>
    /WEB-INF/classes/applicationContextxml,
        
</param-value>
</context-param>
<listener>
          
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>     

 (2)在web.xml中使用Servlet

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



评论
发表评论

您还没有登录,请登录后发表评论

esffor
搜索本博客
最近加入圈子
存档
最新评论