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的字符的时候才不会出错。
|
|