久久久久久久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 集合的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我正在使用 Struts2 做一個項目,但在分配集合時遇到問題.

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

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

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

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

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

                  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 />
                  

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

                  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 是一個 Collection 并且任何其他集合都可以通過屬性進行索引.

                  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>
                  


                  有關此的更多信息,請參閱


                  More about this see

                  按集合的屬性索引集合.

                  也有可能獲得一個獨特的元素通過傳遞給定屬性的值來收集那個元素.默認情況下,屬性集合的元素在<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.

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

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

                  相關文檔推薦

                  quot;Char cannot be dereferencedquot; error(“Char 不能被取消引用錯誤)
                  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 操作數的三元表達式的類型是什么?)
                  Read a text file and store every single character occurrence(讀取文本文件并存儲出現的每個字符)
                  Why do I need to explicitly cast char primitives on byte and short?(為什么我需要在 byte 和 short 上顯式轉換 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. 主站蜘蛛池模板: 99热这里都是精品 | 久久不射电影网 | 久久久久久久av麻豆果冻 | 亚洲激情在线视频 | 久久国产精品无码网站 | 日韩一区二区三区在线播放 | 成人av一区 | 精品一区国产 | 亚洲国产成人精品女人久久久 | 国产欧美日韩在线 | 日韩精品一区二区三区在线播放 | 成人免费激情视频 | 亚洲一区亚洲二区 | 国产免费xxx | 四虎成人免费视频 | 1区2区视频 | 夜夜爽99久久国产综合精品女不卡 | 另类 综合 日韩 欧美 亚洲 | 日韩欧美在线观看一区 | 免费一级黄色录像 | 国产精品久久久久久久一区二区 | 亚州激情 | 青青草视频免费观看 | 国产亚洲精品精品国产亚洲综合 | k8久久久一区二区三区 | 日日操日日舔 | 久久久久亚洲精品 | 欧美一级淫片免费视频黄 | 日韩和的一区二在线 | 久久成人一区 | 成人av免费 | 久久精品免费 | 亚洲福利一区二区 | 人人玩人人添人人澡欧美 | 国产美女黄色片 | 欧美亚洲另类在线 | 精品国产乱码久久久久久果冻传媒 | 日日日视频 | 在线观看av网站永久 | 欧美国产日韩在线观看 | 91社区在线高清 |