struts2 redirect-action 传递参数问题
来源:互联网 发布:opencv实现canny算法 编辑:程序博客网 时间:2024/05/12 21:11
我想在Post被Save 成功之后,直接转到 viewPost 页面,该页面显示主贴及所有跟贴,
也就是由savePost.action 转到 viewPost.action 并且要将主贴的postid作为参数传过去,配置如下:
Note: 红色粗体部分 viewPost?postid=${postid} 不能写成 viewPost.action?postid=${postid}
也就是由savePost.action 转到 viewPost.action 并且要将主贴的postid作为参数传过去,配置如下:
<package name="post" namespace="/post" extends="struts-default">
<action name="savePost" method="savePost" class="net.mengfanpp.bbs.post.web.action.PostAction" >
<result type="redirect-action">viewPost?postid=${postid}</result>
<result name="input">/WEB-INF/pages/post/edit.jsp</result>
</action>
<action name="viewPost" class="net.mengfanpp.bbs.post.web.action.PostAction" method="viewPost">
<result>/WEB-INF/pages/post/view.jsp</result>
</action>
</package>
<action name="savePost" method="savePost" class="net.mengfanpp.bbs.post.web.action.PostAction" >
<result type="redirect-action">viewPost?postid=${postid}</result>
<result name="input">/WEB-INF/pages/post/edit.jsp</result>
</action>
<action name="viewPost" class="net.mengfanpp.bbs.post.web.action.PostAction" method="viewPost">
<result>/WEB-INF/pages/post/view.jsp</result>
</action>
</package>
Note: 红色粗体部分 viewPost?postid=${postid} 不能写成 viewPost.action?postid=${postid}
- struts2 redirect-action 传递参数问题
- struts2 redirect-action 传递参数问题
- struts2中redirect action的参数传递
- struts2中redirect action的参数传递
- Struts2 redirect传递多参数
- Struts2中的redirect参数传递
- struts2.0 struts.xml type="redirect" 传递参数问题
- struts2 中用redirect时 参数的传递
- struts2 action之间传递参数
- struts2.3.4 Action传递参数
- Struts2 'redirect-action' 配置错误问题
- Struts2 'redirect-action' 配置错误问题
- struts2框架中action链传递时的参数问题
- redirect-action传参数
- Struts2中Action间参数传递
- Struts2 action与jsp参数传递机制
- struts2的action之间的参数传递
- Struts2中action传递时间参数
- .net与j2ee构架之争
- 【原创-翻译】C#编码规范
- linux面试题参考答案(转)
- ASP.NET中的输入验证
- 理想、激情、生存——位技术管理人员的20年工作经历和感悟
- struts2 redirect-action 传递参数问题
- 构建高性能J2EE应用的5种策略
- c#中 Enum类型定义与获取值或描述方法
- SQL2005 SQL身份登陆问题
- 第六課 いつしょに 行きませんか
- 在Win2003中批量新增用户
- 类的属性值的读写set ,get设置的实例
- 困惑
- Dell d630,windows server 2003 下驱动安装的总结