throws Exception {
if (log.isDebugEnabled()) {
log.debug("entering 'onSubmit' method...");
}
SvodDefect svodDefect = (SvodDefect) command;
boolean isNew = (svodDefect.getSvodDefectId() == null);
Locale locale = request.getLocale();
if (request.getParameter("delete") != null) {
svodDefectManager.removeSvodDefect(svodDefect.getSvodDefectId().toString());
saveMessage(request, getText("svodDefect.deleted", locale));
} else {
svodDefectManager.saveSvodDefect(svodDefect);
String key = (isNew) ? "svodDefect.added" : "svodDefect.updated";
saveMessage(request, getText(key, locale));
if (!isNew) {
return new ModelAndView("redirect:editSvodDefect.html", "svodDefectId", svodDefect.getSvodDefectId());
}
}
return new ModelAndView(getSuccessView());
}