Spring和Struts的全权委托整合
来源:互联网 发布:淘宝网伟邦碎砖伸缩棍 编辑:程序博客网 时间:2024/05/16 12:12
1.在Action的方法外面定义IDao,并在下面增加set和get函数
2.在Action的方法里面使用IDao的借口
3.在Spring框架的xml内增加
<bean id="dao" class="dao.CustomerDao"></bean>
<bean name="/login" class="prj23_1.action.LoginAction">
<property name="dao">
<ref local="dao"/>
</property>
</bean>
4.在Struts框架的xml内更改为
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<message-resources parameter="Prj23.ApplicationResources" />
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property value="/WEB-INF/applicationContext.xml"
property="contextConfigLocation"/>
</plug-in>
</struts-config>
2.在Action的方法里面使用IDao的借口
3.在Spring框架的xml内增加
<bean id="dao" class="dao.CustomerDao"></bean>
<bean name="/login" class="prj23_1.action.LoginAction">
<property name="dao">
<ref local="dao"/>
</property>
</bean>
4.在Struts框架的xml内更改为
<action
attribute="loginForm"
input="/login.jsp"
name="loginForm"
path="/login"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<set-property property="cancellable" value="true" />
</action>
</action-mappings><message-resources parameter="Prj23.ApplicationResources" />
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property value="/WEB-INF/applicationContext.xml"
property="contextConfigLocation"/>
</plug-in>
</struts-config>
5.注意:Action要继承Action
6.注意可以非单态,可以让Action更加灵活
<bean name="/login" class="prj23_1.action.LoginAction" singleton="false">
阅读全文
0 0
- Spring和Struts的全权委托整合
- struts+hibernate+spring 通过spring的全权代理方式整合
- Spring Struts 的整合(Action 委托)
- struts和spring的整合
- struts和spring的整合!
- 整合 Struts 和 Spring
- struts和spring整合
- 整合 Struts 和 Spring
- 整合 Struts 和 Spring
- Spring和Struts整合
- 整合spring 和struts
- spring和struts整合
- spring 和 struts 整合
- struts 和spring 整合
- 整合Struts和Spring
- Spring和Struts整合
- JPetStore中Struts和Spring的整合
- Spring和Struts的整合方案1
- MySQL主从复制与读写分离的实现
- FloatActionButton
- 最新关于PADS9.5与altium designer 16.0.6交互问题
- 一对多关联关系映射和设置级联属性
- 使用MVP模式+OKHttp网络请求 带编辑删除的购物车
- Spring和Struts的全权委托整合
- 写在开头
- linux 编程 信号处理
- Apache mina 入门(三) —— 客户端同步通讯
- Linux 常用命令
- 一个完整的xhr请求
- Java
- L1-Ansible安装
- Yii2 多语言配置