哈希表中的键 有空研究一下

时间:2021-06-27 05:37:46

<table width="225" border="0" cellspacing="0" cellpadding="0" align="right">
        
    <tr>
            <td height="26" align="center" background="publishfile/smtz_03.jpg">
   
   <table width="90%" height="18" border="0" cellpadding="0" cellspacing="0">
              <tr>
                <td valign="bottom" class="copy12">管理选项</td>
              </tr>
            </table></td>
          </tr>
    <tr>
          <td height="32" align="center" valign="bottom" background="publishfile/smtz_05.jpg">
    <table width="100" height="30" border="0" cellpadding="0" cellspacing="0">
              <tr>
    <td align="left" class="copy14"><a href="index.jsp" target="mainFrame">首页</a></td>
   </tr></table>
     </td></tr>
  
   <tr>
    <%
 Map mapGrade=new TreeMap();
 for (int j=0;j<listGrade.size();j++) { 
  List list11=new ArrayList(); 
  Map map = (Map)listGrade.get(j);
  amount = (String)map.get("amount");
  service = (String)map.get("service");
  referencepoint = (String)map.get("referencepoint");
  fservice = (String)map.get("fatherservice");

  if(amount==null){amount="";}
  if(service==null){service="";}
  if(referencepoint==null){referencepoint="";}
  if(fservice==null){fservice="";}
  out.print(fservice);
  if(mapGrade.containsKey(fservice))
  {
   list11=(List)mapGrade.get(fservice);
   list11.add(map);
   out.print("haha");   
  }
  else
  {
   list11=new ArrayList();
   list11.add(map);
   out.print("嘻嘻");
  }
  mapGrade.put(fservice,list11); 
  }
  
  Object obj[] = mapGrade.keySet().toArray();
  
  for(int i=0;i<mapGrade.size();i++)
  {
   List listleft=(List)mapGrade.get(obj[i]);
   %>
    <tr>
          <td height="32" align="center" valign="bottom" background="publishfile/smtz_05.jpg">
    <table width="100" height="30" border="0" cellpadding="0" cellspacing="0">
              <tr>
    <td align="left" class="copy14" onClick="show(a<%=i+1%>)" style="cursor:hand"><%=(String)obj[i]%></td>
   </tr></table>
     </td></tr>
  
   <tr>
    <td background="publishfile/smtz_07.jpg">
        <DIV id=a<%=i+1%> style="DISPLAY: none">
<table width="100" border="0" cellspacing="0" cellpadding="0" align="center">

  <%
   for(int j=0;j<listleft.size();j++)
   {
   Map map = (Map)listleft.get(j);
   service = (String)map.get("service");
   referencepoint = (String)map.get("referencepoint");
   
   if(service==null){service="";}
   if(referencepoint==null){referencepoint="";}
   %>
    <tr>
   
            <td height="26" align="center" ><a href="<%=referencepoint%>?t=<%=i+1%>" class="copy15"  target="mainFrame"><%=service%></a></td>
          </tr>
   <%
   }
   %>
     </table>
    </div>
 </td>
  </tr>
 <%
  } 
 %>
 
   <tr>
          <td height="103" align="center"
           background="publishfile/smtd_03.jpg"></td>
           <td width="24">&nbsp;</td>
  </tr>
        </table>