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