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