ssmデータ転送model、、request

1093 ワード

   @RequestMapping(value="/list",method=RequestMethod.GET)
    public String list(Model model) {          //          ${ul.value.    }   
        model.addAttribute("userList",userList);    //    userList        
        return "user/userList";            //          
    }

      
     //      Controller      Servlet    ,    model   
    @RequestMapping(value="/userlist",method=RequestMethod.GET)
    public String list(HttpServletRequest request) {      //          ${user.id }   
        List userList = new ArrayList();       
        userList.add(new User("1","yonghu1","121","[email protected]"));        // userList     
        userList.add(new User("2","yonghu2","122","[email protected]"));        
        userList.add(new User("3","yonghu3","123","[email protected]"));
        request.setAttribute("userList", userList);                
        return "user/userList";
    }