1.js中页面跳转
- location.href = path + "/weixin/jsp/submitNewSuccess.jsp?package_number="+package_number
参数接收方式:
- <script type="text/javascript">
- var package_number = "<%=request.getParameter("package_number")%>";
- </script>
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());
页面中接收参数的方式:
- <script type="text/javascript">
- var openid = "<%=request.getSession().getAttribute("openid")%>";
- </script>