Example #1
0
 @RequestMapping(value = "/car/save", method = RequestMethod.POST)
 public View createCar(@ModelAttribute Car car, ModelMap model) {
   if (StringUtils.hasText(car.getId())) {
     carService.updateCar(car);
   } else {
     carService.addCar(car);
   }
   return new RedirectView("/SpringMongod/car");
 }
Example #2
0
 @RequestMapping(value = "/car/delete", method = RequestMethod.GET)
 public View deleteCar(@ModelAttribute Car car, ModelMap model) {
   carService.deleteCar(car);
   return new RedirectView("/SpringMongod/car");
 }
Example #3
0
 @RequestMapping(value = "/car", method = RequestMethod.GET)
 public String getCarList(ModelMap model) {
   model.addAttribute("carList", carService.listCar());
   return "result";
 }