struts 1* + spring

 把struts 1*的action 交给 spring管理 需要改动以下两点

 

  struts-config.xml

  1、加入Spring 插件

       <plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">

          <!--指向Spring 容器 applicationContext.xml-->
          <set-property property="contextConfigLocation"
                 value="/WEB-INF/spring/applicationContext.xml" />
       </plug-in>

 

  2、更改Action 的类为 spring 的 action 代理类

       <action .....
                   type="org.springframework.web.struts.DelegatingActionProxy">

        ..........

       </action>

 

  在Spring 容器 applicationContext.xml 可以对该 action 进行管理了

  eg:

      <bean name="/url" class="类路径">
             <property name="serv">
                  <ref bean="serverImpl" />
             </property>
      </bean>

  在spring 1.0中可以配置 单粒为FALSE,我用的是spring 2.0 没找到 单粒的配置,有时间在想办法

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值