throws Exception {
if (log.isDebugEnabled()) {
log.debug("entering 'onSubmit' method...");
}
DefectCategoryName defectCategoryName = (DefectCategoryName) command;
boolean isNew = (defectCategoryName.getDefectCategoryNameId() == null);
Locale locale = request.getLocale();
if (request.getParameter("delete") != null) {
defectCategoryNameManager.removeDefectCategoryName(defectCategoryName.getDefectCategoryNameId().toString());
saveMessage(request, getText("defectCategoryName.deleted", locale));
} else {
defectCategoryNameManager.saveDefectCategoryName(defectCategoryName);
String key = (isNew) ? "defectCategoryName.added" : "defectCategoryName.updated";
saveMessage(request, getText(key, locale));
if (defectCategoryName.isEdited()) {
return new ModelAndView("redirect:updating.html?id=" + defectCategoryName.getDefectCategoryNameId() + "&fieldId=" + request.getParameter("fieldId"));
}
}
return new ModelAndView("redirect:" + defectCategoryName.getDocLocation());
}