用户管理系统。语言JAVA
public void doPost(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
// 设置编码格式
response.setContentType("text/html;charset=GB18030");
response.setCharacterEncoding("GB18030");
request.setCharacterEncoding("GB18030");
//调用业务逻辑
UserDAO userDAO = new UserDAO();
// 返回的list值
ArrayList list=userDAO.queryAll();
//重点。。。HttpSession的用处???
HttpSession session= request.getSession();
// 设置session的值
session.setAttribute("userList", list);
//跳转到显示的页面,格式(得到当前页面的+要跳转的页面)
response.sendRedirect(request.getContextPath()+"/manager.jsp");
}
2019-12-21 20:59:20
2.99MB
UMS
JAVA
1