One - One Code All

Blog Content

spring mvc modellist添加model方法

Java   2020-02-29 22:37:52

sprig mvc modelList添加model方法。

 @RequestMapping(value = "/submitUserList_1", method ={RequestMethod.POST})
    @ResponseBody
    public String submitUserList_1(HttpServletResponse response,Integer[] id, String[] name, String[] pwd)
                            throws Exception{
        String result = "";
        if(id == null || id.length <= 0){ return "No any ID.中文"; }
        List userList = new ArrayList();
        for (int i = 0; i < id.length; i++ ) {
            User user = new User();
            user.setId(id[i]);
            user.setName(name[i]);
            user.setPwd(pwd[i]);
            userList.add(user);
        }
        result = this.showUserList(userList);
        return result;
    }



上一篇:Java字符串中子字符串查找
下一篇:SourceTree克隆代码报错_Mac:warning templates not found /usr/local/git/share/git-core/templates

The minute you think of giving up, think of the reason why you held on so long.