Struts中的controller使用
来源:互联网 发布:软件开发工作思路 编辑:程序博客网 时间:2024/06/07 21:50
在Struts中加入Spring框架的时候,相信大家对
<action-mapping>
<action input="/login.jsp"
name="loginActionForm"
path="/loginAction"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy"
validate="false">
<forward name="success" path="/success.jsp" />
<forward name="failure" path="/failure.jsp" />
</action>
</action-mapping>
这段代码 是再熟悉不过吧。不过每个Action都加这个东西。会不会觉得很累呢。有点。。现在好了。。有这个办法可以解决这个问题。
就是在struts-config.xml中的使用<contrlller>
<controller>
<set-property property="processorClass" value="org.springframework.web.struts.DelegationRequestProcessor"/>
</controller>
这样就可以把Struts的Action 交给Spring控制了。。
也不用在Action中写上type="org.springframework.web.struts.DelegatingActionProxy"
最后的代码样式为:
<action-mapping>
<action input="/login.jsp"
name="loginActionForm"
path="/loginAction"
scope="request"
type="org.springframework.web.struts.DelegatingActionProxy"
validate="false">
<forward name="success" path="/success.jsp" />
<forward name="failure" path="/failure.jsp" />
</action>
</action-mapping>
<controller>
<set-property property="processorClass" value="org.springframework.web.struts.DelegationRequestProcessor"/>
</controller>
快去试试吧。。
- Struts中的controller使用
- struts-config.xml中的controller元素
- struts-config.xml中的controller元素
- 引用 struts-config.xml中的controller元素
- Struts Controller
- struts controller components
- struts controller(chapter 2)
- [原创]使用struts中的标记
- Struts 1.1 Controller UML diagrams
- Struts 配置文件里面 Controller是什么意思
- 关于springmvc 中的Controller使用自动装配失败的解决方法
- Struts中的下拉列表标签的使用
- Struts中的下拉列表标签的使用
- 通配符在struts.xml中的使用
- struts中的验证框架的使用
- pringMVC中的Controller
- Grails中的Controller单元测试
- SpringMVC中的Controller
- curl默认链接选项里没有包括Windows常用库
- 行进中开火
- 一年编程经验总感想-----EndAll
- axis2 webservice 简单例子
- Java读取XML文件之SAX篇
- Struts中的controller使用
- JAVA读取XML文件
- 我的辞职报告
- 【转帖】第一次找工的经典写实
- 关于DNS的不完全总结
- 使用FFMPEG编码保存MPEG-1/MPEG-2文件格式
- DataGrid使用技巧大杂烩
- 解释LR controller里的error output
- 网络安全与防火墙1