THIS IS A TEST INSTANCE. ALL YOUR CHANGES WILL BE LOST!!!!
...
Code Block |
---|
public class SaveMarksAction extends ActionSupport { private Map marks = new HashMap(); public Map getMarks() { return marks; } public String execute() throws Exception { // get list of candidate IDs List candidateIds = marks.keySet(); for (Iterator iter = candidateIds.iterator(); iter.hasNext();) { String candidateId = (String) iter.next(); String mark = parseMap(marks.get(candidateId)); // process candidates and marks... } } // helper function to parse the map of entries.... private static String parseMap(String[] map) { if (map == null) { return null; } if (map.length != 1) { return null; } return map[0]; } } |
...
Explanation
The resulting vm file is rendered as
...
Couple tabular inputs with some sortable table component (javascript, client side)
or
DisplayTag (server side)
...