public class ViewProfileServlet extends HttpServlet {
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
HttpSession httpSession=request.getSession();
Student student=new Student();
String stuId=(String)httpSession.getAttribute("stuId");//取出session中保存的id
student.setId(stuId);
//System.out.println(stuId);
StuDao stuDao=new StuDao();
Student student2=new Student();
student2=stuDao.getStudent(student);
//System.out.println(student2.toString());
httpSession.setAttribute("stu",student2);
request.getRequestDispatcher("/Profile.jsp").forward(request,response);
}
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
}
}
javaweb学生管理系统-----查看个人信息功能实现
最新推荐文章于 2021-07-28 20:00:42 发布