java 日记 2008/10/20(spring,struts 整合)
来源:互联网 发布:linux怎么卸载光盘 编辑:程序博客网 时间:2024/05/21 17:12
今天才發現我的ssh 并沒有整合在一起
一直在action 中這樣使用dao
ApplicationContext ctx=new classfile.........("applicationContext.xml");
.....ctx.getbean("...")
早上使了一下整合,出現在了一些問題,就此給有同樣問題的朋友。
1.配置plug-in
<plug-in className="org.springframework.web.struts.ContextLoaderPlugIn">
<set-property property="contextConfigLocation"
value="/WEB-INF/classes/applicationContext.xml"/>
</plug-in>
2. type 改為type="org.springframework.web.struts.DelegatingActionProxy">
<action
attribute="userForm"
input="/login.jsp"
name="userForm"
path="/showUser"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy">
<forward name="error" path="/index.jsp" />
<forward name="success" path="/t1.html" />
</action>
3.在applicationcontext.xml中配置action bean
<!-- Action bean -->
<bean name="/showUser" class="com.ts.struts.action.ShowUserAction">
<property name="usersDAO" > 注意這裡,這個是在action 聲明的域,醃要給這個域產成set,get方法
<ref bean="UsersDAO" /> 這個是域的類開型。在這裡卡了半天,一個是變量變,一個是變量的類型。
</property>
</bean>
- java 日记 2008/10/20(spring,struts 整合)
- java 日记 2008/10/20(spring,struts 整合二)
- struts、spring、hibernate等框架的整合培训日记
- Java开发,重在整合-----Struts 2整合Spring(15)
- struts整合spring整合hibernate
- 整合 struts spring hibernate
- Spring , Struts整合方法
- 整合Struts 与Spring
- 整合Struts 与Spring
- struts整合spring
- struts+spring+hibernate整合
- struts,hibernate,spring整合
- 整合 Struts 和 Spring
- struts+spring+hibernate整合
- struts+spring+hibernate整合
- struts+spring整合测试
- 整合Struts 与Spring
- struts和spring整合
- java文件操作大全
- 模式
- 如何取得从1900年到现在的时间
- 格式化命令行日期显示
- 巴菲特高调说“买” 中外基金经理齐声说“NO”
- java 日记 2008/10/20(spring,struts 整合)
- DES类C#仿真
- 命令行模式下判断是否目录
- 二进制数据形式保存和获取图片
- OleDbParameter在使用中需要注册参数的顺序
- 走进PIMShell(1)--为什么是这样
- Linux内核源代码结构
- 金融风暴来袭理财稳健当头 支招如何保住本金
- DES-C#