我是靠谱客的博主 单身早晨,这篇文章主要介绍Struts中ActionForward带参数跳转,现在分享给大家,希望可以做个参考。

在Struts Action中跳转一般是用return mapping.findForward("file_delete_one");

但如果要在后面带参数了,则需要如下的处理才行:

   ActionForward forward=mapping.findForward("file_delete_one");
   ActionForward newForward=new ActionForward();
   String newPath=forward.getPath() +"&attTFileTable="+attTFileTable+"&type="+type+"&infoId="+infoId;
   newForward.setPath(newPath);
   //newForward.setRedirect(true);   //是否以sendRedirect方式跳转
   return newForward;

此中方法是一种比较的方法,还有一种方法,则是使用

response.sendRedirect(url);
return null;

这种方式来进行跳转,使用哪种方式看具体程序来定,不过个人认为还是使用第一种方式比较好.

转载于:https://www.cnblogs.com/freedom831215/archive/2009/10/27/1590687.html

最后

以上就是单身早晨最近收集整理的关于Struts中ActionForward带参数跳转的全部内容,更多相关Struts中ActionForward带参数跳转内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(90)

评论列表共有 0 条评论

立即
投稿
返回
顶部