if (request.getParameter("cansel") != null) {
return new ModelAndView("redirect:/lookGost.html");
}
Gost gost = (Gost) command;
if (gost.getGostId() != null) {
gostManager.updateGost(gost);
if (gost.isEdited()) {
return new ModelAndView("redirect:updating.html?id=" + gost.getGostId() + "&fieldId=" + request.getParameter("fieldId"));
}
return new ModelAndView("redirect:/lookGost.html");
} else {
gostManager.insertGost(gost);
if (gost.isEdited()) {
return new ModelAndView("redirect:updating.html?id=" + gost.getGostId() + "&fieldId=" + request.getParameter("fieldId"));
}
mav.addObject("result", Integer.valueOf(1));
}
mav.addObject("gost", new Gost());
return mav;
}