页面跳转参数携带与参数接收的几种方式

1.js中页面跳转

location.href = path + "/weixin/jsp/submitNewSuccess.jsp?package_number="+package_number

参数接收方式:


2.java代码中页面重定向/转发

request.setAttribute("openid", openid);
request.getRequestDispatcher("/weixin/jsp/weixinLogin.jsp").forward(request, response);
页面中参数接收方式:

var openid =  "<%=request.getAttribute("openid")%>";
把参数在java代码里面放到session里面:

request.getSession().setAttribute("openid", openId());
页面中接收参数的方式:






你可能感兴趣的:(Web前端)