<action path="/EngageMajorIssue"
type="com.three.web.action.applications.EngageMajorIssueAction"
parameter="operate"
scope="request">
<forward name="listAllByPage" path="Engage.do"></forward>
</action>
type="com.three.web.action.applications.EngageMajorIssueAction"
parameter="operate"
scope="request">
<forward name="listAllByPage" path="Engage.do"></forward>
</action>
解决方案 »
- 急急急急急急急————100分————————关于heml
- 急!!一个关于sendRedirect("/text.html?msg="+java.net.URLEncoder.encode("中国人"))的问题
- 这网站有什么意思?
- JSP +JDBC的数据问题???急
- 如何在jsp页面分页显示查询到的记录
- java.net.UnknownHostException:www.x.com 网址解析不了
- jacob调用问题。急!
- 请问问题出在哪?
- 简单问题:substring用法?
- tomcat4.0.1 的问题,请教各位大哥!
- 各位:hibernate的saveorupdate是根据什么判断的?
- 求助:jdbc连接oracle运行时弹出错误。
恩,我又想问,假如我用的是SSH,那么这样就成了action调用action,而我的事务开始是配置在service的方法里,那么岂不是要开两次事务.是不是这么回事啊?高手指点
恩,是这么回事啊,不过我的(action1)delete和(action2)listAllByPage要从页面取得的参数不同,可是我又想action1执行完之后再跳回到action2要跳过去的页面,所以不得不跳转到action2我用的是DispatchAcyion
public ActionForward delete(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
String[] trainIds = request.getParameterValues("delid");
trainService.deleteTrain(trainIds);
return this.listAllByPage(mapping, form, request, response); }this.listAllByPage(mapping, form, request, response);这是此action的另外一个方法,
public ActionForward listAllByPage(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
String page = request.getParameter("page");
String pcount = request.getParameter("pcount");
UtilPage2 utilPage2 = trainService.findByPage(page,pcount);
request.setAttribute("utilPage2", utilPage2);
request.setAttribute("operate", "listAllByPage");
return mapping.findForward("listByPage");
}
其中的utilPage2在service中已经被注入,而delete必须是在listAllByPage执行完之后才可能执行,所以每次delete之后,它能从spring里取出来以前的utilPage2.所以能跳过去刚才的页面并执行完删除.可是我不确定这样的调用this.listAllByPage(mapping, form, request, response);是不是规范?是否要想办法让delete从页面取得page和pcount..谢谢高手啦
对新手来说,用forward容易因客户f5,重复提交
2 效率上有点问题,每次forward到新的action,都会导致一次新的form的reset/populate/validate(request.getParameter("x")-->form.getX()的过程,称之为populate),如果表单复杂,容易出现性能问题,或者不易控制。你说的spring的问题有点类似