Cyh的博客

Email:kissyan4916@163.com
posts - 26, comments - 19, trackbacks - 0, articles - 220

Spring联合Struts和Hibernate开发

Posted on 2009-02-16 20:09 啥都写点 阅读(129) 评论(0)  编辑  收藏 所属分类: J2EE

1 把上面的type换成type=”org.springframework.web.struts.DelegatingActionProxy”

 2 并且在struts-config.xml中加入:  

<plug-in

              className="org.springframework.web.struts.ContextLoaderPlugIn">

              <set-property property="contextConfigLocation"

                     value="/WEB-INF/classes/applicationContext.xml" />

       </plug-in>

 作用是方便spring来管理

3、在applicationContext中加入:

  <bean name="/person" class="org.lxh.struts.action.PersonAction">

            <property name="persondao">

                   <ref bean="persondao"/>

            </property>

     </bean>

第二种实现:

 不用改变Action中的type

 struts-config.xml中加入

<controller

              processorClass="org.springframework.web.struts.DelegatingRequestProcessor">

</controller>





                                                                                                       --    学海无涯
        


只有注册用户登录后才能发表评论。


网站导航: