黑马程序员技术交流社区
标题:
updateServlet
[打印本页]
作者:
heimadragon
时间:
2019-10-10 12:14
标题:
updateServlet
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
request.setCharacterEncoding("utf-8");
Map<String, String[]> map = request.getParameterMap();
User user = new User();
try {
BeanUtils.populate(user,map);
} catch (IllegalAccessException e) {
e.printStackTrace();
} catch (InvocationTargetException e) {
e.printStackTrace();
}
UserService us=new UserServiceImpl();
us.updateUser(user);
response.sendRedirect(request.getContextPath()+"/userListServlet");
}
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/)
黑马程序员IT技术论坛 X3.2