我是靠谱客的博主 单身早晨,最近开发中收集的这篇文章主要介绍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带参数跳转所遇到的程序开发问题。

如果觉得靠谱客网站的内容还不错,欢迎将靠谱客网站推荐给程序员好友。

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

评论列表共有 0 条评论

立即
投稿
返回
顶部