在你的Servlet类的最上面写 声明个HttpSession session = request.getSession();然后在初始化的init()里面写 session.setAttribute(“arg0”, arg1);