今天学习了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文件中将值变为全局变量