protected ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception {
EntryForm form = (EntryForm)command;
getBlogManager().saveEntry(form, SessionSecurityManager.getUser(request));
if (form.getAttachment() != null) {
Attachment attachment = new Attachment();
attachment.setContentType("");
attachment.setFileData(form.getAttachment());
attachment.setFileName("attachment.txt");
getBlogManager().attachToEntry(attachment, form.getEntryId());
}
return new ModelAndView(getSuccessView());
}