How to pass a List of Maps to a GSP page view and iterate over it
问题 Let's say we want to show information about the files of a folder. We have to save the information of each file in a Map. Then, add these Maps to a List. Controller action: def show() { List results = new ArrayList(); File dir = getDir(params.id); if (dir.exists()) { dir.eachFile { Map fileInformation= new java.util.LinkedHashMap() fileInformation.put("name", it.getName()); fileInformation.put("size", it.length()); fileInformation.put("path", it.getAbsolutePath() ); results.add