views:

1354

answers:

1

Hi.. I m doing a stuf in JAVA, as it is working fine.. now i need it to display in a browser using JSP, the following is my code..

Hashtable<String, Hashtable<String, Integer>> hash =
      categoryCountManager.getFunctionWithSubFunctionCount(1L);

     setCategoryDetails(categoryCountManager.getFunctionWithSubFunctionCount(1L));

     //count.setFunction()
     System.out.println("Hash Size==>"+hash.size());  


     Set<String> functions = hash.keySet();

     for(String fun : functions){
      System.out.println("***************************");                      
      System.out.println(fun);
      System.out.println("***************************");
      Hashtable<String, Integer> obj = hash.get(fun);


      Vector<String> v = new Vector<String>(obj.keySet());
      Collections.sort(v);

      for(String str : v){                            
       System.out.println("#"+str+"-"+obj.get(str));
       }



      }

Any suggestions highly appreciated..

Thanks in advance.

A: 
for (Entry<String, Hashtable<String, Integer>> functionEntry : hash.entrySet()) {
    System.out.println("***************************");                      
    System.out.println(fun);
    System.out.println("***************************");
    for (Entry<String, Integer> subfunction : functionEntry.getValue().entrySet()) {
        System.out.println("#" + subfunction.getKey() + "-" + subfunction.getValue());
    }
}

This doesn’t sort your subfunctions, though.

Bombe