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

  • <small id='NQmbe'></small><noframes id='NQmbe'>

        • <bdo id='NQmbe'></bdo><ul id='NQmbe'></ul>
        <legend id='NQmbe'><style id='NQmbe'><dir id='NQmbe'><q id='NQmbe'></q></dir></style></legend>

        <i id='NQmbe'><tr id='NQmbe'><dt id='NQmbe'><q id='NQmbe'><span id='NQmbe'><b id='NQmbe'><form id='NQmbe'><ins id='NQmbe'></ins><ul id='NQmbe'></ul><sub id='NQmbe'></sub></form><legend id='NQmbe'></legend><bdo id='NQmbe'><pre id='NQmbe'><center id='NQmbe'></center></pre></bdo></b><th id='NQmbe'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='NQmbe'><tfoot id='NQmbe'></tfoot><dl id='NQmbe'><fieldset id='NQmbe'></fieldset></dl></div>
        <tfoot id='NQmbe'></tfoot>

        如何在 Struts 2 中將值插入 Set 集合

        How to insert a value into Set collection in Struts 2(如何在 Struts 2 中將值插入 Set 集合)
      1. <i id='mtZY2'><tr id='mtZY2'><dt id='mtZY2'><q id='mtZY2'><span id='mtZY2'><b id='mtZY2'><form id='mtZY2'><ins id='mtZY2'></ins><ul id='mtZY2'></ul><sub id='mtZY2'></sub></form><legend id='mtZY2'></legend><bdo id='mtZY2'><pre id='mtZY2'><center id='mtZY2'></center></pre></bdo></b><th id='mtZY2'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='mtZY2'><tfoot id='mtZY2'></tfoot><dl id='mtZY2'><fieldset id='mtZY2'></fieldset></dl></div>
          <tbody id='mtZY2'></tbody>

                <bdo id='mtZY2'></bdo><ul id='mtZY2'></ul>
              • <legend id='mtZY2'><style id='mtZY2'><dir id='mtZY2'><q id='mtZY2'></q></dir></style></legend>

                <small id='mtZY2'></small><noframes id='mtZY2'>

                  <tfoot id='mtZY2'></tfoot>
                  本文介紹了如何在 Struts 2 中將值插入 Set 集合的處理方法,對(duì)大家解決問題具有一定的參考價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我正在使用 Struts2 做一個(gè)項(xiàng)目,但在分配集合時(shí)遇到問題.

                  I am doing a project using Struts2 and I have a problem assigning a set collection.

                  這是我的操作(我刪除了不相關(guān)的部分)

                  Here's my Action (I eliminated the irrelevant part)

                  public class TeamAction extends BaseAction implements ModelDriven<Team>
                  {
                   Team team=new Team();
                  
                  }
                  

                  這是我的模型Team(我去掉了不相關(guān)的部分)

                  Here's my model Team (I eliminated the irrelevant part)

                  private TeamId id;
                  private Set students = new HashSet(0);
                  

                  這是我的 JSP 部分

                  Here's my JSP part

                  <input type="text" name=team.student[0].id />
                  

                  現(xiàn)在的問題是我無法通過 ModelDriven 將正確的值插入到這個(gè) Set 集合中,它會(huì)拋出異常.你能告訴我在 JSP 文件中寫什么,以便我可以在我的模型中向 Set 集合插入一個(gè)值嗎?

                  Now the problem is I can't insert the right value into this Set collection in by ModelDriven, it will throw a exception. Could you please tell me what to write in JSP file, so I can insert a value to Set collection in my model?

                  推薦答案

                  Set 是一個(gè) Collection 并且任何其他集合都可以通過屬性進(jìn)行索引.

                  Set is a Collection and as any other collection could be indexed by a property.

                  @Element(value = Student.class)
                  @Key(value = Integer.class)
                  @KeyProperty(value = "id") 
                  @CreateIfNull(value = true)
                  private Set<Student> students = new HashSet(0);
                  //getter and setter, also for Student class that should have Integer id.
                  

                  在 JSP 中

                  <s:iterator value="students " var="student">
                    <s:textfield name="students(%{#student.id}).name" />
                  </s:iterator>
                  


                  有關(guān)此的更多信息,請(qǐng)參閱


                  More about this see

                  按集合的屬性索引集合.

                  也有可能獲得一個(gè)獨(dú)特的元素通過傳遞給定屬性的值來收集那個(gè)元素.默認(rèn)情況下,屬性集合的元素在<Class>->conversion.properties 使用KeyProperty_xxx=yyy,其中 xxx 是屬性返回集合的 bean Classyyy 是集合元素的屬性我們要索引.

                  It is also possible to obtain a unique element of a collection by passing the value of a given property of that element. By default, the property of the element of the collection is determined in <Class>->conversion.properties using KeyProperty_xxx=yyy, where xxx is the property of the bean Class that returns the collection and yyy is the property of the collection element that we want to index on.

                  這篇關(guān)于如何在 Struts 2 中將值插入 Set 集合的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  quot;Char cannot be dereferencedquot; error(“Char 不能被取消引用錯(cuò)誤)
                  Java Switch Statement - Is quot;orquot;/quot;andquot; possible?(Java Switch 語句 - 是“或/“和可能的?)
                  Java Replace Character At Specific Position Of String?(Java替換字符串特定位置的字符?)
                  What is the type of a ternary expression with int and char operands?(具有 int 和 char 操作數(shù)的三元表達(dá)式的類型是什么?)
                  Read a text file and store every single character occurrence(讀取文本文件并存儲(chǔ)出現(xiàn)的每個(gè)字符)
                  Why do I need to explicitly cast char primitives on byte and short?(為什么我需要在 byte 和 short 上顯式轉(zhuǎn)換 char 原語?)

                  <i id='aTgIp'><tr id='aTgIp'><dt id='aTgIp'><q id='aTgIp'><span id='aTgIp'><b id='aTgIp'><form id='aTgIp'><ins id='aTgIp'></ins><ul id='aTgIp'></ul><sub id='aTgIp'></sub></form><legend id='aTgIp'></legend><bdo id='aTgIp'><pre id='aTgIp'><center id='aTgIp'></center></pre></bdo></b><th id='aTgIp'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='aTgIp'><tfoot id='aTgIp'></tfoot><dl id='aTgIp'><fieldset id='aTgIp'></fieldset></dl></div>
                • <tfoot id='aTgIp'></tfoot>
                  • <bdo id='aTgIp'></bdo><ul id='aTgIp'></ul>

                      <small id='aTgIp'></small><noframes id='aTgIp'>

                    • <legend id='aTgIp'><style id='aTgIp'><dir id='aTgIp'><q id='aTgIp'></q></dir></style></legend>

                            <tbody id='aTgIp'></tbody>

                          1. 主站蜘蛛池模板: 中国一级大毛片 | 免费成人国产 | 欧美456| 久久久精品网站 | www在线| 精品一二三区在线观看 | 欧美精品首页 | 精品成人av | 无码国模国产在线观看 | 久产久精国产品 | 国产丝袜一区二区三区免费视频 | 秋霞国产 | 免费黄色在线观看 | 久久久久久国产一区二区三区 | 日韩三级一区 | 亚洲一区二区国产 | 91在线电影 | 天天综合网7799精品 | 国户精品久久久久久久久久久不卡 | 久久精品视频网站 | 欧美成人在线网站 | 黄视频网站免费观看 | 亚洲a网 | 国产一二三区免费视频 | 一级片毛片 | 欧美老妇交乱视频 | 国产精品无码久久久久 | 久久免费视频2 | 日韩精品久久 | 国产一区二区av | 欧美一区永久视频免费观看 | 黑人一级片视频 | 香蕉大人久久国产成人av | 欧美日韩中文国产一区发布 | 毛色毛片免费看 | 国产wwwcom | 国产精品国产a | 中文字幕在线精品 | 一级黄色片免费在线观看 | 日韩在线免费电影 | 国产h在线 |