1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
   | public class ActionsDetailControl implements Controller {
 
 
    public ModelAndView handleRequest(HttpServletRequest request,
                                      HttpServletResponse response) throws ServletException, IOException {
 
        ModelAndView mav;
 
        ClassPathXmlApplicationContext ctx = new ClassPathXmlApplicationContext( "applicationContext.xml");
 
        List results = ((OperationsClient) ctx.getBean("operationsClient"))
                .findAll();
 
        if (request.getParameter("operation").equals("afficher")
                && request.getParameter("choix").equals("client")) {
 
              mav = new ModelAndView("home", "table", results);
 
        } else {
 
            Map<String, Object> chOp = new HashMap<String, Object>();
            chOp.put("operation", request.getParameter("operation"));
            chOp.put("choix", request.getParameter("choix"));
            chOp.put("clients", results);
 
            mav = new ModelAndView("detailOperation", "chOp", chOp);
        }
 
        return mav;
 
    } | 
Partager