修改功能代码实现用户修改

修改功能代码实现用户修改

public class UserListServlet extends HttpServlet {
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//1.调用UserService完成查询
UserServiceImpl service = new UserServiceImpl();
List<User> users = service.findAll();
//2.将list存入request域
req.setAttribute("users",users);
//3.转发到list.jsp
req.getRequestDispatcher("/list.jsp").forward(req,resp);
}

@Override
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
doGet(req, resp);
}
}

 

posted @ 2022-08-19 19:39  一位程序袁  阅读(33)  评论(0编辑  收藏  举报