BindException errors) throws Exception {
LevelPlan levelPlan = (LevelPlan) command;
if (request.getParameter("cancel") != null) {
return new ModelAndView("redirect:levelPlanList.html?objectId="+levelPlan.getObjectId());
}
File file = new File(FileHelper.getCurrentPath(request) + levelPlan.getWayToLevelPlan());
if (levelPlan.getWayToLevelPlan() != null && !levelPlan.getWayToLevelPlan().equals("") && file.exists()) {
levelPlan.setLevelBlob(Hibernate.createBlob(new FileInputStream(FileHelper.getCurrentPath(request) + levelPlan.getWayToLevelPlan())));
}
if (levelPlan.getLevelId() != null) {
detailSymbolManager.update(levelPlan);
return new ModelAndView("redirect:levelPlanList.html?objectId="+levelPlan.getObjectId());
} else {
BuildingObject buildingObject=buildingObjectManager.getBuildingObject(levelPlan.getObjectId().toString());
buildingObject.getLevelPlanList().add(levelPlan);
detailSymbolManager.insert(levelPlan);
buildingObjectManager.saveBuildingObject(buildingObject);
}
ModelAndView mav = new ModelAndView(getSuccessView());
LevelPlan levelPlan1 = new LevelPlan();
String saveWay = ImageUtil.getUniqueJPEGFile(request);
mav.addObject("saveWay", saveWay);
levelPlan1.setWayToLevelPlan(saveWay);
String saveWayImage = "image" + saveWay;
levelPlan1.setWayToLevelPlanImage(saveWayImage);
mav.addObject("saveWayImage", saveWayImage);
levelPlan1.setObjectId(levelPlan.getObjectId());
mav.addObject("levelPlan", levelPlan1);
mav.addObject("result", new Integer(1));
return mav;
}