throws Exception {
if (log.isDebugEnabled()) {
log.debug("entering 'onSubmit' method...");
}
MaterialClassification materialClassification = (MaterialClassification) command;
boolean isNew = (materialClassification.getMaterialClassificationId() == null);
Locale locale = request.getLocale();
if (!materialClassification.getMaterial().getMaterialId().equals(new Integer(-1))) {
materialClassification.setMaterial(materialManager.getMaterial(materialClassification.getMaterial().getMaterialId().toString()));
}
materialClassificationManager.saveMaterialClassification(materialClassification);
String key = (isNew) ? "materialClassification.added" : "materialClassification.updated";
saveMessage(request, getText(key, locale));
return new ModelAndView("redirect:" + materialClassification.getDocLocation());
}