道听途说Struts2之15:chain跳转到另外的一个包中的action
2012-04-09 16:43
507 查看
这个应该不是什么问题,只是想说明有时候看文档是最简单也是最快速的学习这些东西的方法。
有时候我们做一些东西,认为自己写的是正确的,但是怎么调试修改都不正确,这时候应该是先看文档,然后找搜索引擎,最后才是问老师。如果自己能够解决的,一定要培养自己解决问题的习惯和能力,有时候我们都挺懒的,都想遇到问题就想别人给我解答。但是不是会一直有这么一个人,所以如果想一直能够解决问题,就得培养自己的这种能力。
在使用chain的时候,我感觉应该跳转到某个包直接写包名/action就可以了,但是实验了许多次都不成功。最后查文档,根本就不是这样配置。它是使用参数的方式配置的,下面我们文档中的配置例子贴出来,一看就明白了:
有时候我们做一些东西,认为自己写的是正确的,但是怎么调试修改都不正确,这时候应该是先看文档,然后找搜索引擎,最后才是问老师。如果自己能够解决的,一定要培养自己解决问题的习惯和能力,有时候我们都挺懒的,都想遇到问题就想别人给我解答。但是不是会一直有这么一个人,所以如果想一直能够解决问题,就得培养自己的这种能力。
在使用chain的时候,我感觉应该跳转到某个包直接写包名/action就可以了,但是实验了许多次都不成功。最后查文档,根本就不是这样配置。它是使用参数的方式配置的,下面我们文档中的配置例子贴出来,一看就明白了:
<package name="public" extends="struts-default"> <!-- Chain creatAccount to login, using the default parameter --> <action name="createAccount" class="..."> <result type="chain">login</result> </action> <action name="login" class="..."> <!-- Chain to another namespace --> <result type="chain"> <param name="actionName">dashboard</param> <param name="namespace">/secure</param> </result> </action> </package> <package name="secure" extends="struts-default" namespace="/secure"> <action name="dashboard" class="..."> <result>dashboard.jsp</result> </action> </package>
相关文章推荐
- chain跳转到另外的一个包中的action
- struts2声明式验证input视图跳转到另外一个action后错误提示不显示解决办法
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2如何从一个Action转到另外一个Action
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2 跳转类型介绍 result type=chain、dispatcher、redirect(redirect-action)
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- 【转】struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)_forever
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts2的action重定向到另外一个action,如何传参数?
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)
- struts1.2中从一个action跳转到另外一个action
- struts2 跳转类型 result type=chain、dispatcher、redirect(redirect-action)_forever