@Override
protected ModelAndView onSubmit(HttpServletRequest request,
HttpServletResponse response, Object command, BindException errors)
throws Exception {
Structure structure = (Structure) command;
String clazz = structure.getType();
String locale = localeContainer.getLocale();
String structureLocale = (String) request.getParameter("locale");
if (!structureLocale.isEmpty())
{
structure.setLocale(structureLocale);
}
else
{
structure.setLocale(locale);
}
boolean newhotel = (structure.getId() == 0);
this.replaceImageIfNotPresent(structure);
localeContainer.setLocale(structure.getLocale());
this.addStructure((Structure) structure);
localeContainer.setLocale(locale);
request.setAttribute("structure", structure);
if(newhotel){
return super.onSubmit(request, response, command, errors);