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

    <small id='5ZlcW'></small><noframes id='5ZlcW'>

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

      <legend id='5ZlcW'><style id='5ZlcW'><dir id='5ZlcW'><q id='5ZlcW'></q></dir></style></legend>

      如何使用 ajax 響應列表作為 struts2 迭代器值?

      How to use ajax response list as struts2 iterator value?(如何使用 ajax 響應列表作為 struts2 迭代器值?)
      <tfoot id='uyJqP'></tfoot>
          <bdo id='uyJqP'></bdo><ul id='uyJqP'></ul>

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

            <tbody id='uyJqP'></tbody>
          <legend id='uyJqP'><style id='uyJqP'><dir id='uyJqP'><q id='uyJqP'></q></dir></style></legend>

            • <i id='uyJqP'><tr id='uyJqP'><dt id='uyJqP'><q id='uyJqP'><span id='uyJqP'><b id='uyJqP'><form id='uyJqP'><ins id='uyJqP'></ins><ul id='uyJqP'></ul><sub id='uyJqP'></sub></form><legend id='uyJqP'></legend><bdo id='uyJqP'><pre id='uyJqP'><center id='uyJqP'></center></pre></bdo></b><th id='uyJqP'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='uyJqP'><tfoot id='uyJqP'></tfoot><dl id='uyJqP'><fieldset id='uyJqP'></fieldset></dl></div>
              • 本文介紹了如何使用 ajax 響應列表作為 struts2 迭代器值?的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                我正在使用以下 ajax 函數(shù):

                 $.ajax({網址:用戶主加載",內容類型:'應用程序/json',類型:'POST',數(shù)據(jù)類型:'json',異步:真,成功:函數(shù)(res){alert(res[i].name+" "+res[i].rollNo);} });

                我在警告框中得到了正確的結果.現(xiàn)在我想在struts迭代器中使用這個ajax返回的列表,如下所示:

                <s:iterator value="list">

                <s:property value='name'></s:property><s:property value="rollNo"></s:property></div></s:迭代器>

                但屏幕上沒有顯示任何內容.誰能告訴我該怎么做?

                解決方案

                @AndreaLigios 請解釋第二種類型的結果,即 JSP 片段.我不知道如何使用 JSP 片段作為 ajax 響應.

                Main.jsp(完整)

                <%@ taglib prefix="s" uri="struts-tags.tld" %><html><頭><腳本>$(函數(shù)(){$('#loader').on("按鍵點擊", function(e) {$.ajax({url: "<s:url action='ajaxAction'/>",}).done(函數(shù)(結果){$("#target").html(結果);});});});</腳本></頭><身體><input type="button" id="loader"/><div id="target"></div><身體></html>

                Struts.xml(相關)

                <action name="ajaxAction" class="foo.bar.AjaxAction"><result>Snippet.jsp</result></動作>

                AjaxAction(相關)

                私有字符串 testString;/* Getter 和 Setter */公共字符串執(zhí)行(){testString = "我加載了 AJAX";返回成功;}

                Snippet.jsp(完整)

                <%@ taglib prefix="s" uri="struts-tags.tld" %><!-- 這是結果頁面.你可以在這里使用 Struts 標簽,生成的 HTML 將附加到目標 div.-->測試字符串:<s:property value="testString"/>

                輸出:

                <input type="button" id="loader"/><div id="target">TestString:我加載了AJAX</div><身體>

                I am using following ajax function :

                 $.ajax({
                       url: "userhomeonload",
                       contentType: 'application/json',
                       type: 'POST',
                      datatype:'json', 
                       async: true,
                       success: function (res) {
                                 alert(res[i].name+" "+res[i].rollNo);
                    }  });
                

                I am getting correct result in alert box. Now I want to use the list returned by this ajax in struts iterator as follows :

                <s:iterator value="list">
                   <div>
                     <s:property value='name'></s:property>
                     <s:property value="rollNo"></s:property>
                   </div>
                </s:iterator> 
                

                But nothing is getting displayed on screen. Can anyone tell me how can I do so?

                解決方案

                @AndreaLigios please explain 2nd type of result i.e. JSP snippet.I don't know how to use JSP snippet as ajax response.

                Main.jsp (complete)

                <%@ taglib prefix="s" uri="struts-tags.tld" %>
                <html>
                    <head>
                        <script>
                            $(function(){   
                                $('#loader').on("keypress click", function(e) {
                                    $.ajax({
                                        url: "<s:url action='ajaxAction'/>",
                                    }).done(function(result) {
                                        $("#target").html(result);
                                    });
                                });
                            });
                        </script>   
                    </head>
                    <body>
                        <input type="button" id="loader" />
                        <div id="target"></div>
                    <body>
                </html>
                

                Struts.xml (relevant)

                <action name="ajaxAction" class="foo.bar.AjaxAction">
                    <result>Snippet.jsp</result>
                </action>
                

                AjaxAction (relevant)

                private String testString;
                /* Getter and Setter */
                
                public String execute(){
                   testString = "I'm loaded with AJAX";
                   return SUCCESS;
                }
                

                Snippet.jsp (complete)

                <%@ taglib prefix="s" uri="struts-tags.tld" %>
                
                <!-- This is the result page. You can use Struts tags here, 
                the generated HTML will be appended to the target div. -->
                
                TestString: <s:property value="testString" />
                

                Output:

                <body>
                    <input type="button" id="loader" />
                    <div id="target">TestString: I'm loaded with AJAX</div>
                <body>
                

                這篇關于如何使用 ajax 響應列表作為 struts2 迭代器值?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

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

                相關文檔推薦

                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 間隔)
                How can I modify the XMLHttpRequest responsetext received by another function?(如何修改另一個函數(shù)接收到的 XMLHttpRequest 響應文本?)
                What is the difference between XMLHttpRequest, jQuery.ajax, jQuery.post, jQuery.get(XMLHttpRequest、jQuery.ajax、jQuery.post、jQuery.get 有什么區(qū)別)

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

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

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

                    <tbody id='LYtYD'></tbody>

                        1. 主站蜘蛛池模板: 久久99视频免费观看 | av免费在线观看网站 | 日韩精品一区二区三区 | 日韩精品人成在线播放 | 青青草一区二区三区 | 91一区二区三区在线观看 | 日韩欧美在线一区二区 | 国产精品一区在线 | 2018中文字幕第一页 | 亚洲aⅴ| 成人欧美日韩一区二区三区 | 在线一区二区观看 | 亚洲iv一区二区三区 | 国产一级一级毛片 | 欧美一级网站 | 国产精品久久久久久久久污网站 | 日韩欧美中文字幕在线观看 | 综合二区| 夜夜爽99久久国产综合精品女不卡 | 欧美一区二区三区在线免费观看 | 99久久99久久精品国产片果冰 | 精品国产一区探花在线观看 | 九九综合| 欧美精品国产精品 | 日本人麻豆| 精品国产一区久久 | 亚洲精品中文字幕av | 一级黄色片美国 | 成人夜晚看av | 日韩成人一区 | 91av在线影院 | 91福利在线观看 | 毛片国产| 一区二区三区在线 | 成人免费网站www网站高清 | 国产精品欧美精品 | 中文字幕在线免费观看 | 午夜三级视频 | 久久久久亚洲av毛片大全 | 黄网免费 | 一级毛片在线播放 |