ctx.put("isCommentPage", Boolean.TRUE);
ctx.put("escapeHtml", new Boolean(escapeHtml) );
ctx.put("autoformat", new Boolean(autoFormat) );
// Make sure comment form object is available in context
CommentFormEx commentForm =
(CommentFormEx) request.getAttribute("commentForm");
if ( commentForm == null ) {
commentForm = new CommentFormEx();
// Set fields to spaces to please Velocity
commentForm.setName("");
commentForm.setEmail("");
commentForm.setUrl("");
commentForm.setContent("");
}
ctx.put("commentForm",commentForm);
// Either put a preview comment in to context
if ( request.getAttribute("previewComments")!=null ) {
ArrayList list = new ArrayList();
CommentData cd = new CommentData();
commentForm.copyTo(cd, request.getLocale());
list.add(CommentDataWrapper.wrap(cd));
ctx.put("previewComments",list);
}
WeblogEntryData entry = rreq.getWeblogEntry();