您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

从一个jsp向另一个jsp发送变量

从一个jsp向另一个jsp发送变量

您有多种选择:

        // Memorise any passed in user.
    String username = request.getParameter("username");
    if (username != null && username.length() > 0) {
      session.setAttribute("username", username);
    }
        <input name="username" type="hidden" value=""/>
        username = getCookie(userCookieName);

    // Get from cookie.
    function getCookie(name) {
      if (document.cookie) {
        index = document.cookie.indexOf(name);
        if (index !== -1) {
          f = (document.cookie.indexOf("=", index) + 1);
          t = document.cookie.indexOf(";", index);
          if (t === -1) {
            t = document.cookie.length;
          }
          return(document.cookie.substring(f, t));
        }
      }
      return ("");
    }
        sessionStorage.setItem("username", "...");
        .... onclick="window.location='details.jsp?username=...'
其他 2022/1/1 18:16:13 有424人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶