配置文件大概如下:
<action-mappings>
<action path="/account"
name="accountForm"
parameter="action"
scope="request"
type="com.ai.uaap.admin.web.action.AccountAction">
<forward name="listOK" path="/AccountMaster.jsp" />
<forward name="removeOK" path="/account.do?action=list" redirect="true" />
</action>
我在执行完remove的方法之后的代码是return
mapping.findForward("removeOK")。这时就会访问account.do?action=list这个地址,以前我想在
account.do?action=list之后继续添加参数(例如account.do?action=list&abc=123)不知道该
怎么实现。
今天看到一个资料给出了实现:
String path = mapping.findForward("removeOK").getPath();
ActionForward forward = new ActionForward(path + "&abc=123", true);
//这里的true是Redirect
return forward;
分享到:
相关推荐
Struts2中Action接收参数的方法
ActionForward的使用 1、理解全局和局部ActionForward的概念 2、redirect的使用 3、struts-config.xml文件不允许动态修改 4、理解动态ActionForward,动态的ActionForward是可以运行期修改的
资源中示例了一个struts2的配置文件中配置的action的result结果为另外一个action的配置,该跳转的过程中是带所有参赛调整的,在另外一个action中可以接受到当前action的所有参数,此配置文件是我日常开发中的经验...
Struts2 Action参数详细说明,很有用的。
action跳转后的页面接收由上一个ACTION传过来的参数
Struts如何解决中文添加到数据库
NULL 博文链接:https://cdxs2.iteye.com/blog/1925245
如果validate ()返回非空的ActionErrors,将会被转到input属性指定的URI,如果返回空的ActionErrors,那么执行Action的 execute() 方法,根据返回的ActionForward确定目标URI。 这样做的效果是:execute()仅当...
我们知道,Struts2完成参数传递处理工作的基础是...2. 在参数传递的过程中,做恰当的类型转化,保证页面上的字符串能够转化成各 式各样的Java对象 接下来,通过四个不同的角度,来具体讲述Struts2在这两个方面的工作。
程序参考源代码 博文链接:https://honly-java.iteye.com/blog/1605764
NULL 博文链接:https://cdxs2.iteye.com/blog/1926357
06 在Struts 2.0中实现表单数据校验(Validation) 07 Struts 2的基石——拦截器(Interceptor) 08 在Struts 2中实现IoC 09 在Struts 2中实现文件上传 10 在Struts 2中实现CRUD 11 Struts 2中的OGNL 12 trus 2的新...
从jsp页面提交form表单后,在struts.xml中寻找匹配的action。在action中处理完业务后返回,在struts.xml中的result属性中转向到另外一个action。
一个比较简单的struts的dispatchAction 类的入门案例,适合初学者理解dispatchAction
JS调用Struts中的ActionJS调用Struts中的ActionJS调用Struts中的Action
Struts in Action 英文版和对照翻译的中文修正,可对照阅读,在学习Struts的同时也学习一些专业术语
下载后解压直接导入到Myeclipse中发布到tomcat后运行即可,源代码没有错误,已运行试过,三种方法转换的时候需要修改strut.xml中的Action
struts action struts action struts action struts action
详细理解一下Struts2的参数,有助于对Struts2更深的体会!
Struts2在Action中获得Response对象的四种方法