@RequestMapping(value = "/insertcomment", method = RequestMethod.POST) public String InsertComent( @RequestParam("comicId") String comicId, @RequestParam("comment") String comment, HttpSession httpSession) { System.out.println("comment:" + comment); User user = (User) httpSession.getAttribute("user"); if (user != null) { Comment c = new Comment(); c.setComicId(comicService.GetComic(comicId)); c.setCommentDes(comment); c.setDateTime(new Date()); c.setUserId(user); comicService.InsertComment(c); } return "redirect:/comic/comiclist/" + comicId; }