HI,
I m doing the folling stuff in the jsp code I need to do it using Struts or using JSTL tag can any body have relevant idea please share..
The following is my JSP code
<% Object category = request.getAttribute('categoryDetails'); Hashtable<String, Hashtable<String, Integer>> cat = (Hashtable<String, Hashtable<String, Integer>>) category; //out.print(cat.entrySet()); Set<String> functions = cat.keySet(); for(String fun : functions){ out.print('-----------'); out.print(fun); out.print('-----------'); Hashtable<String, Integer> obj = cat.get(fun); Vector<String> subFunction = new Vector<String>(obj.keySet()); Collections.sort(subFunction); for(String str : subFunction){ out.print('#'+str+'-'+obj.get(str)); } } %>
Thanks in advance.
You can use a custom tag or create a temporary view structure like this:
Then you just expost a method called List getFunctionsView() on your controller and use a simple nested jstl foreach loop.
Edit: Had to rework this one slightly.