KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > petals > demo > icare > web > ListController


1 package org.objectweb.petals.demo.icare.web;
2
3 import javax.servlet.ServletException JavaDoc;
4 import javax.servlet.http.HttpServletRequest JavaDoc;
5 import javax.servlet.http.HttpServletResponse JavaDoc;
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 /**
12  * The controller for the pages that show lists of entities
13  *
14  * @author Cristian Spiescu
15  * @since 14.01.2007
16  */

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     /**
30      * Shows a list with all the cars in the database
31      *
32      * @param request
33      * @param response
34      * @return
35      * @throws ServletException
36      */

37     @Override JavaDoc
38     protected ModelAndView handleRequestInternal(HttpServletRequest JavaDoc arg0, HttpServletResponse JavaDoc arg1) throws Exception JavaDoc {
39         return new ModelAndView("carList", "cars", getCarService().getAllCars());
40     }
41
42 }
43
Popular Tags