コード例 #1
0
ファイル: AddVehicleController.java プロジェクト: racerm3/DMV
 public ModelAndView updateVehicle(HttpServletRequest request, HttpServletResponse response)
     throws Exception {
   ModelAndView model = new ModelAndView(LiConstants.JSP_ADD_VEHICLE);
   Vehicle dataBean =
       vehicleBusiness.findAndKeepVehicleByID(new Long(getVehicleIdFromSession(request)));
   VehicleInfoBean formBean = new VehicleInfoBean();
   helper.convertDataBeanToFormBean(dataBean, formBean);
   formBean.setVinVerifiedFlag(true);
   model.addObject(VEHICLE_PARAM, formBean);
   loadReferenceData(request, model);
   populateSelectedVehicle(request, dataBean);
   return model;
 }
コード例 #2
0
ファイル: AddVehicleController.java プロジェクト: racerm3/DMV
 public ModelAndView saveVehicle(
     HttpServletRequest request, HttpServletResponse response, VehicleInfoBean formBean)
     throws Exception {
   ModelAndView model = null;
   Vehicle dataBean = null;
   if (getVehicleIdFromSession(request) != null) {
     dataBean = vehicleBusiness.findAndKeepVehicleByID(new Long(getVehicleIdFromSession(request)));
   } else {
     dataBean = new Vehicle();
   }
   helper.convertFormBeanToDataBean(formBean, dataBean);
   vehicleBusiness.saveVehicle(dataBean);
   request.getSession().setAttribute(LiConstants.SESSION_VEHICLE_ID, dataBean.getId().toString());
   if (formBean.getTitleContext() != null && formBean.getTitleContext().booleanValue()) {
     model =
         new ModelAndView(
             new RedirectView(
                 "processOriginalTitle.do?formAction=addVehicle&_vehicleId=" + dataBean.getId()));
   } else {
     model = new ModelAndView(new RedirectView(VEHICLE_VIEW_BASIC_RECORD));
   }
   return model;
 }