/** * 对学生信息的修改,可以是学生本身或者管理员 * * @return * @throws Exception */ public String updateS() throws Exception { init(); String studentId = request.getParameter("studentId"); // 从请求参数过来的是老师更改 if (studentId == null) { studentId = request.getSession().getAttribute("USER_ID").toString(); // 从session获得的是学生更改的 } Student student = personService.getStudent(studentId); String imageUrl = student.getImageUrl(); if (imageUrl != null) { oldPicturePath = imageUrl; imageUrl = imageUrl.substring(imageUrl.lastIndexOf("\\") + 1); String relativeUrl = "File/images/" + imageUrl; student.setImageUrl(relativeUrl); } request.setAttribute("student", student); return "updateSSuccess"; }