每日随笔

今天学习了http中的session函数

private void select(HttpServletRequest req, HttpServletResponse resp) throws IOException, Exception {
req.setCharacterEncoding("utf-8");
List<classes> list = dao.Select();
HttpSession session = req.getSession();
session.setAttribute("list", list);
req.getRequestDispatcher("chooseclass.jsp").forward(req, resp);
}

在java文件中将值变为全局变量

posted @ 2020-11-29 20:22  不详·Christina  阅读(43)  评论(0编辑  收藏  举报