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

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

        <bdo id='oHebA'></bdo><ul id='oHebA'></ul>
      <tfoot id='oHebA'></tfoot>
      <legend id='oHebA'><style id='oHebA'><dir id='oHebA'><q id='oHebA'></q></dir></style></legend>

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

      1. 通過 Ajax 調用使用 Struts 2 的 HTTP 數組參數

        HTTP Array Parameters with Struts 2 via an Ajax Call(通過 Ajax 調用使用 Struts 2 的 HTTP 數組參數)

          • <bdo id='tYIXh'></bdo><ul id='tYIXh'></ul>

            1. <small id='tYIXh'></small><noframes id='tYIXh'>

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

                    <tbody id='tYIXh'></tbody>
                  <tfoot id='tYIXh'></tfoot>
                • 本文介紹了通過 Ajax 調用使用 Struts 2 的 HTTP 數組參數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                  問題描述

                  我在將數組參數發送到 Struts 2 操作類時遇到問題.我正在使用 struts 2.1.8.1.

                  I'm having an issue sending array parameters to a Struts 2 action class. I am using struts 2.1.8.1.

                  下面是一些示例代碼:

                  public class MyAction extends ActionSupport {
                  
                      private String[] types;
                  
                      public String execute() {
                          return SUCCESS;
                      }
                  
                      public String[] getTypes() {
                          return types;
                      }
                  
                      public void setTypes(String[] types) {
                          this.types = types;
                      }
                  }
                  

                  問題是通過jquery ajax方法發送數組時:

                  The problem is when sending an array via the jquery ajax method:

                  $.ajax({
                      type: 'POST',
                      url: 'Myaction.action',
                      data: {
                          types: ["this", "is", "a", "test"]
                      }
                  });
                  

                  導致異常發生:

                  ognl.ParseException: 在第 1 行第 7 列遇到"]" "] "".

                  如何使用 jQuery 將數組發送到我的 Struts2 動作類?我需要包含類似于攔截器的東西嗎?或者 jQuery 中有一個選項可以刪除它嗎?

                  How can I use jQuery to send the array to my Struts2 action class? Is there something along the lines of an interceptor that I need to include? Or is there an option in jQuery to remove this?

                  我在使用 jQuery UI 可排序控件時也遇到了這個問題,但我使用正則表達式刪除了[]"字符解決了這個問題.我想避免這種情況,因為那個解決方案讓我很困擾.我想我可以自己構建字符串,而不是使用對象表示法,但除非你能說服我,否則我想使用對象表示法.

                  I also encountered this problem with the jQuery UI Sortable control, but I solved that using a regex to remove the "[]" characters. I would like to avoid that, because that solution bothers me. I suppose I could just build the string myself, instead of using the object notation, but unless you can convince me otherwise, I would like to use the object notation instead.

                  推薦答案

                  IIRC Struts 不喜歡 jQuery 1.4+ 格式,不過你可以使用傳統格式,只要把它放在你的 $.ajax() 調用:

                  IIRC Struts doesn't like the jQuery 1.4+ format, you can use the traditional format though, just put this any time before your $.ajax() call:

                  $.ajaxSettings.traditional = true; 
                  

                  您可以在 $.param() 文檔,最好的說明是他們的簡短示例:

                  You can read more about the 1.4+ default vs traditional serialization in the $.param() documentation, the best illustration is their short example:

                  // <=1.3.2: (traditional in 1.4+)
                  $.param({ a: [2,3,4] }) // "a=2&a=3&a=4"
                  // >=1.4: (default in 1.4+)
                  $.param({ a: [2,3,4] }) // "a[]=2&a[]=3&a[]=4"
                  

                  這篇關于通過 Ajax 調用使用 Struts 2 的 HTTP 數組參數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                  相關文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調用完成)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發技術分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  NETWORK_ERROR: XMLHttpRequest Exception 101(NETWORK_ERROR:XMLHttpRequest 異常 101)
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內容)
                  XmlHttpRequest onprogress interval(XmlHttpRequest onprogress 間隔)
                    <tbody id='8CSX4'></tbody>

                    <legend id='8CSX4'><style id='8CSX4'><dir id='8CSX4'><q id='8CSX4'></q></dir></style></legend>

                    <tfoot id='8CSX4'></tfoot>

                    <small id='8CSX4'></small><noframes id='8CSX4'>

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

                          • <bdo id='8CSX4'></bdo><ul id='8CSX4'></ul>
                            主站蜘蛛池模板: 麻豆一区二区三区 | 中文字幕1区2区 | 99精品欧美一区二区蜜桃免费 | 妹子干综合 | 亚洲一区二区三区视频 | 日韩精品国产精品 | 国产一区二区影院 | a免费视频 | 成人免费在线视频 | 不卡一二三区 | 99精品国产一区二区三区 | 91在线网| 一级黄色毛片a | 91精品国产综合久久婷婷香蕉 | 在线观看精品视频网站 | 国产精久久久久久久 | 久久毛片 | 午夜看片网站 | 亚洲国产精品视频 | 国产精品 亚洲一区 | 亚洲国产一区二区视频 | 正在播放国产精品 | 亚洲福利在线观看 | 久久国产精品久久久久久久久久 | 成人午夜在线 | 91激情视频 | 国产高清视频在线观看播放 | 国产精品揄拍一区二区 | 欧美日韩精品一区二区三区四区 | 国产一级免费在线观看 | 亚洲二区在线观看 | 精品一区二区三区四区五区 | 男女网站免费观看 | 天堂色区 | 国产成人福利 | 91福利在线导航 | 成人在线免费电影 | 国产三级 | 成人免费在线 | 精品一区在线看 | 日本中文字幕一区 |