* @throws
* @return
*/
@Override
protected ModelAndView onSubmit (HttpServletRequest request, HttpServletResponse response, Object command, BindException errors) throws Exception{
Typology typology = (Typology) command;
String locale = localeContainer.getLocale();
String typologyLocale = (String)request.getParameter("locale");
if (!typologyLocale.isEmpty()){
typology.setLocale(typologyLocale);
}
else{
typology.setLocale(locale);
}
boolean newTypology = (typology.getId() == 0);
localeContainer.setLocale(typology.getLocale());
typology.setStructure((Structure) structureManager.get(typology.getHotelId()));
this.addTypology(typology);
localeContainer.setLocale(locale);
request.setAttribute("typology", typology);
if(newTypology){
return super.onSubmit(request, response, command, errors);