/** * 处理教师信息的修改 * * @return * @throws IOException * @throws Exception */ public String updateTDeal() throws Exception { init(); if (pictureUpload() != null) { teacher.setPictureUrl(pictureUpload()); if (oldPicturePath != null) { // 设置了新的图片就删除原来的图片 File file = new File(oldPicturePath); if (file.exists()) { file.delete(); } } } personService.updateTeacher(teacher); response.getWriter().write("<script type='text/javascript'> alert('修改教师信息成功')</script>"); response.flushBuffer(); response.getWriter().close(); return NONE; }