zoukankan      html  css  js  c++  java
  • request.setAttribute("username", username);//一定要保存,OGNL才能获取${username}

    public void doGet(HttpServletRequest request, HttpServletResponse response)
    throws ServletException, IOException {
    request.setCharacterEncoding("utf-8");
    String username= request.getParameter("username");
    request.setAttribute("username", username);//一定要保存,OGNL才能获取${username}

    //也可以保存在session中,但是好像视频说不好


    //或者直接在jsp页面中用<%=request.getParameter("username")获取,两种结果一样,但是后者有null
    request.getRequestDispatcher("/dologin.jsp").forward(request, response);

    }

  • 相关阅读:
    11.10
    11.9
    11.8 总结
    11.7
    11.6
    日报10.6
    日报10.5
    每周总结-3
    日报10.4
    日报10.2
  • 原文地址:https://www.cnblogs.com/xuedexin/p/5671893.html
Copyright © 2011-2022 走看看