throws Exception {
if (log.isDebugEnabled()) {
log.debug("entering 'onSubmit' method...");
}
Parameter parameter = (Parameter) command;
boolean isNew = (parameter.getParameterId() == null);
Locale locale = request.getLocale();
if (request.getParameter("delete") != null) {
parameterManager.removeParameter(parameter.getParameterId().toString());
saveMessage(request, getText("parameter.deleted", locale));
} else {
Integer measureId = parameter.getMeasure().getMeasureId();
if (!measureId.equals(new Integer(-1))) {
parameter.setMeasure(measureManager.getMeasure(measureId.toString()));
}
parameterManager.saveParameter(parameter);
String key = (isNew) ? "parameter.added" : "parameter.updated";
saveMessage(request, getText(key, locale));
if (parameter.isEdited()) {
return new ModelAndView("redirect:updating.html?id=" + parameter.getParameterId() + "&fieldId=" + request.getParameter("fieldId"));
}
}
return new ModelAndView("redirect:" + parameter.getDocLocation());
}