ModelAndView mav = new ModelAndView(Constants.PROJECT_VIEW);
int projectId = WebUtil.parameter2int(request.getParameter("projectId"));
User user = (User)request.getSession().getAttribute(Constants.USER_SESSION);
Project project = projectService.getById(projectId);
Date lastSavedMap = mapService.getLastSaveDate(project);
project.setLastEdit(lastSavedMap);
if(project!=null && (user.getUserGroup().getLevel()==Constants.USER_GROUP_SUPERUSER || user.getCustomer().getId()==project.getCustomer().getId())){
List<Map[]> mapsByProjectAndUniqueName = mapService.getAllByProjectWithUniqueName(project, MAX_RESULT);
request.getSession().setAttribute(Constants.PROJECT_ID_FOR_EXHIBITOR_VIEW, new Integer(projectId));
mav.addObject("allMapsByName", mapsByProjectAndUniqueName);
mav.addObject("customerId", project.getCustomer().getId());
mav.addObject("project", project);
}
else{
mav = null;
response.sendRedirect("/it/lista-progetti/");