1 package org.objectweb.petals.demo.icare.web; 2 3 import javax.servlet.ServletException ; 4 import javax.servlet.http.HttpServletRequest ; 5 import javax.servlet.http.HttpServletResponse ; 6 7 import org.objectweb.petals.demo.icare.service.CarService; 8 import org.springframework.web.servlet.ModelAndView; 9 import org.springframework.web.servlet.mvc.AbstractController; 10 11 17 public class ListController extends AbstractController { 18 19 private CarService carService; 20 21 public CarService getCarService() { 22 return carService; 23 } 24 25 public void setCarService(CarService carService) { 26 this.carService = carService; 27 } 28 29 37 @Override 38 protected ModelAndView handleRequestInternal(HttpServletRequest arg0, HttpServletResponse arg1) throws Exception { 39 return new ModelAndView("carList", "cars", getCarService().getAllCars()); 40 } 41 42 } 43 | Popular Tags |