分享

struts中action带参数跳转

 WindySky 2007-05-25
action中实现动态跳转得一个方法

public class RegmobileAction extends Action {
 public ActionForward execute(
  ActionMapping mapping,
  ActionForm form,
  HttpServletRequest request,
  HttpServletResponse response)
  throws Exception
 {
  String url;
   url = "http://200.94.206.237:8070/order?"
     +"&CPKeys:=626A737977&Itemid=124444"
     +"&FeeNumber="+request.getParameter("phone")
     +"&Feetype=2&CTtag="+request.getParameter("CTtag")
     +"&backUrl=http://mms./mov/index.jsp"
     +"&deliverurl=http://mms./mov/deliver.do";
    ActionForward gotourl = new ActionForward(url);//url可以根据不同得条件指定不同得地址和不同得参数
  gotourl.setPath(url);
gotourl.setRedirect(true);
  return gotourl;
 }
 
在URL中的参数值是否要考虑用URLEncoder的encode方法转换一下,这样在参数值有中文字符等其它Unicode的字符的时候才不会出错。

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多