reset password
Author Message
ansuya
Posts: 8
Posted 16:44 May 20, 2009 |

Comment comment = (Comment) command;
         
          BlogEntry blogentry = blogEntryDao.getBlogEntryById(Integer.parseInt(request.getParameter("blogEntryId")));
         
         
         
         
          User user = userDao.getUserByName( SecurityUtils.getUsername() );       
          Calendar creationDate= Calendar.getInstance();
         
          comment.setCreationDate(creationDate);
          comment.setBlogentry(blogentry);
          comment.setUserId(user);
          commentDao.saveComment(comment);
          List<Comment> cmnt=  commentDao.ListOfComment(blogentry);
              
          return new ModelAndView( "blog/displayComment" ).addObject("blogentry", blogentry ).addObject("cmnt",cmnt).addObject("user",user);

This is code for my AddCommentcontroller and when i click on submit button it does not store in the database and forward as well.

 

There is not error in log file.

cysun
Posts: 2935
Posted 17:01 May 20, 2009 |

Check the action attribute of the form and make sure it goes to the controller's URL. If it does, put a break point in the controller and debug it.

ansuya
Posts: 8
Posted 22:32 May 20, 2009 |

thank you professor.

Last edited by ansuya at 22:33 May 20, 2009.