久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

遍歷 HashMap<String, ArrayList<String>

Iterate over an HashMaplt;String, ArrayListlt;Stringgt;gt; with Struts 2(遍歷 HashMaplt;String, ArrayListlt;Stringgt;gt;使用 Struts 2)
本文介紹了遍歷 HashMap<String, ArrayList<String>>使用 Struts 2的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我目前在使用 Struts2 和 s:iterate 標簽時遇到了一些困難.

I am currently facing some difficulties with Struts2 and the s:iterate tag.

我想顯示一個標簽,它是 HashMap 中的鍵,然后是一個包含 ArrayList 中每個元素的表(HashMap 中的值),用于 HashMap 中的每個元素.

I want to display a label, which is the key in the HashMap, followed by a table (the value in the HashMap) containing every elements in the ArrayList, for each elements in the HashMap.

例如,

     label
  ----------
  | test1  |
  ----------
  | test2  |
  ----------



    label2
  ----------
  | test1  |
  ----------
  | test2  |
  ----------

我看到了很多關于 HashMap 的示例,但沒有找到適合我的案例.

I saw a lot of example for an HashMap but didn't find one for my case.

我該怎么做?

謝謝,

推薦答案

<s:iterator value="map">
  <h3><s:property value="key" /></h3>
  <table>
  <s:iterator value="value">
    <tr><td><s:property /></td></tr>
  </s:iterator>
  </table>
</s:iterator>

map 的迭代器是 Map.Entry,它被放入值堆棧并具有兩個訪問器,getKey() 和 getValue().遍歷打印鍵的條目,然后遍歷打印值的值.(列表項被放在值堆棧的頂部,因此 s:property 只打印頂部.)

The iterator of a map is Map.Entry which gets put on the value stack and has two accessors, getKey() and getValue(). Iterate over Entry printing the key, then iterate over the values printing the value. (The list item gets put on top of the value stack so s:property just prints the top.)

這篇關于遍歷 HashMap&lt;String, ArrayList&lt;String&gt;&gt;使用 Struts 2的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Java Remove Duplicates from an Array?(Java從數組中刪除重復項?)
How to fix Invocation failed Unexpected Response from Server: Unauthorized in Android studio(如何修復調用失敗來自服務器的意外響應:在 Android 工作室中未經授權)
AES encryption, got extra trash characters in decrypted file(AES 加密,解密文件中有多余的垃圾字符)
AES Error: Given final block not properly padded(AES 錯誤:給定的最終塊未正確填充)
Detecting incorrect key using AES/GCM in JAVA(在 JAVA 中使用 AES/GCM 檢測不正確的密鑰)
AES-256-CBC in Java(Java 中的 AES-256-CBC)
主站蜘蛛池模板: 美国av毛片 | 国产精品看片 | 99精品在线观看 | 亚洲视频一区二区三区 | 人人澡人人射 | 欧美成人免费 | 毛片入口| 国产精品久久久久久久久久久免费看 | 日韩国产中文字幕 | 91视频一区 | 乱一性一乱一交一视频a∨ 色爱av | 一区二区三区亚洲 | 亚洲色图综合 | 色小姐综合网 | 欧美日在线 | 99久久精品免费看国产小宝寻花 | 国产91久久久久蜜臀青青天草二 | 蜜桃视频在线观看免费视频网站www | 色婷婷婷婷色 | dy天堂| 天久久| 日本天堂视频在线观看 | 中文字幕一二三区 | 亚洲伊人a | 男人的天堂中文字幕 | 在线国产视频 | 一区二区三区四区不卡视频 | 日韩电影免费在线观看中文字幕 | 欧美性另类 | 国产亚洲精品一区二区三区 | 成人在线视频免费看 | 四虎午夜剧场 | 黄在线免费观看 | 在线看av的网址 | 天天爱天天操 | 深夜爽视频 | 中文字幕中文字幕 | 日韩成人免费视频 | 欧美日韩精品中文字幕 | 一区免费看 | 免费精品 |