} else if (!blogEntry.isCommentsEnabled()) {
return new CommentConfirmationView();
}
comment = createComment(request, blogEntry);
ValidationContext context = validateComment(comment);
// are we previewing or adding the comment?
String previewButton = I18n.getMessage(blog, "comment.previewButton");
ContentDecoratorContext decoratorContext = new ContentDecoratorContext();
decoratorContext.setView(ContentDecoratorContext.DETAIL_VIEW);
decoratorContext.setMedia(ContentDecoratorContext.HTML_PAGE);
Comment decoratedComment = (Comment)comment.clone();
blog.getContentDecoratorChain().decorate(decoratorContext, decoratedComment);
getModel().put("decoratedComment", decoratedComment);
getModel().put("undecoratedComment", comment);
getModel().put("rememberMe", rememberMe);
getModel().put(Constants.BLOG_ENTRY_KEY, blogEntry);
getModel().put(Constants.COMMENT_KEY, comment);
request.getSession().setAttribute("rememberMe", request.getParameter("rememberMe"));
if (submitType == null || submitType.equalsIgnoreCase(previewButton) || context.hasErrors()) {
return new CommentFormView();
} else {
CommentConfirmationStrategy strategy = blog.getCommentConfirmationStrategy();
Comment clonedComment = (Comment)comment.clone();