可以有这样写:
1.重定向方式
这样也可以传值
<!--StartFragment -->@Results({
@Result(name="pay", location="/alipay/test2.action?sid=${sid}",type="redirect")
})
@Result(name="pay", location="/alipay/test2.action?sid=${sid}",type="redirect")
})
2.chain方式:
<!--StartFragment -->
@Result(name="pay", location="test2",type="chain",params={"namespace","/alipay"})
3.chain方式不是execute方法:
test2!pay.action
@Result(name = "redirectCode", location = "test2",params={"method","pay"}, type = "chain")
如果需要跨命名空间,还需要配置namespace
相关推荐
struts2配置文件传值中文乱码
struts2使用域模型传值,如何在struts2中使用与模型传值
默认包路径包含action,actions,struts,struts2的所有包都会被struts作为含有Action类的路径来搜索。你可以通过设置struts.convention.package.locators属性来修改这个配置。如: <constant name="struts.convention....
包括一个说明文档、所用到的jar包和一个创建好的项目
Struts 2使用注解配置Action,不配置struts.xml,通过注解直接配置action
STRUTS2零配置.docSTRUTS2零配置.docSTRUTS2零配置.doc
简述STRUTS2_Convention零配置
struts2 零配置 使我们项目开发时可以减少很多配置,能够通过一定的规则操作,不需要在配置 result action...等等之类的多于配置
采用Struts2注解,视图层采用FreeMarker的一个示例项目。 欢迎下载学习。
struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置文件以及代码示例struts2配置...
NULL 博文链接:https://jayung.iteye.com/blog/1881075
·Struts2配置文件介绍 struts.xml action package ·Struts2配置文件介绍 struts.xml action package
struts2前后台传值交互的理解
NULL 博文链接:https://username2.iteye.com/blog/1817573
struts2231零配置 struts2231零配置
struts2注解配置Action及拦截器几种不同方式写法对应的路径指向.docx
STRUTS2:零配置插件CodeBehind
该项目主要是struts2.3的零配置,里面包含两个action,下载后导入myeclipse后,部署后。可以直接访问http://localhost:8080/struts2/abc.action、login.action\login1.action。这里的返回值是以json方式返回。
从struts2.1开始,struts2不再推荐使用Codebehind作为零配置插件,而是改为使用Convention插件来支持零配置,和Codebehind相比,Convention插件更彻底,该插件完全抛弃配置信息,不仅不需要是使用struts.xml文件进行...