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

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

    1. <legend id='6OGWi'><style id='6OGWi'><dir id='6OGWi'><q id='6OGWi'></q></dir></style></legend>

      1. <tfoot id='6OGWi'></tfoot>
          <bdo id='6OGWi'></bdo><ul id='6OGWi'></ul>

        如何使用javascript調(diào)用Struts2 Action Class方法中的方

        How to call a method in Struts2 Action Class method with javascript(如何使用javascript調(diào)用Struts2 Action Class方法中的方法)

              <bdo id='0QP05'></bdo><ul id='0QP05'></ul>
              1. <legend id='0QP05'><style id='0QP05'><dir id='0QP05'><q id='0QP05'></q></dir></style></legend>

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

                • <small id='0QP05'></small><noframes id='0QP05'>

                  本文介紹了如何使用javascript調(diào)用Struts2 Action Class方法中的方法的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我們目前使用以下 javascript 在其中一個字段值更改時提交表單.

                  We currently use the following javascript to submit the form when one of the field values change.

                  var url = "project/location/myAction.action?name="+ lname ; 
                  document.forms[0].action = url;
                  document.forms[0].submit();
                  

                  調(diào)用以下 Struts2 動作

                  which calls the following Struts2 action

                  <action name="myAction" class="project.location.NameAction">
                      <result name="success" type="tiles">myAction</result>   
                  </action>
                  

                  然后轉(zhuǎn)到 Action 類 NameActionexecute() 方法,我必須檢查表單是否是從 javascript 提交的.

                  which then goes to the execute() method of the Action class NameAction where I have to check to see if the form was submitted from the javascript.

                  我更愿意直接從 javascript 調(diào)用 NameAction 中的 findName() 方法.換句話說,我希望 javascript 的行為類似于以下 jsp 代碼.

                  I would prefer to call the findName() method in NameAction directly from the javascript. In other words I want the javascript to act like the following jsp code.

                  <s:submit method="findName" key="button.clear" cssClass="submit" >
                  

                  推薦答案

                  實現(xiàn)你想要的有不同的方法,但可能更簡單的是將不同的動作映射到同一個動作類文件的不同方法,例如.帶注釋:

                  There are different ways to achieve what you want, but probably the simpler is to map different actions to different methods of the same action class file, eg. with annotations:

                  public class NameAction {
                  
                      @Action("myAction")
                      public String execute(){ ... }
                  
                      @Action("myActionFindName")
                      public String findName(){ ... }
                  
                  }
                  

                  或使用 XML:

                  <action name="myAction" class="project.location.NameAction">
                      <result name="success" type="tiles">myAction</result>   
                  </action>
                  
                  <action name="myActionFindName" class="project.location.NameAction" method="findName">
                      <result name="success" type="tiles">myAction</result>   
                  </action>
                  

                  然后在javascript中:

                  Then in javascript:

                  var url = "project/location/myActionFindName.action?name="+ lname ;
                  

                  這篇關(guān)于如何使用javascript調(diào)用Struts2 Action Class方法中的方法的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

                  相關(guān)文檔推薦

                  Browser waits for ajax call to complete even after abort has been called (jQuery)(即使在調(diào)用 abort (jQuery) 之后,瀏覽器也會等待 ajax 調(diào)用完成)
                  JavaScript innerHTML is not working for IE?(JavaScript innerHTML 不適用于 IE?)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標(biāo)頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  Is it possible for XHR HEAD requests to not follow redirects (301 302)(XHR HEAD 請求是否有可能不遵循重定向 (301 302))
                  XMLHttpRequest 206 Partial Content(XMLHttpRequest 206 部分內(nèi)容)
                  Restrictions of XMLHttpRequest#39;s getResponseHeader()?(XMLHttpRequest 的 getResponseHeader() 的限制?)

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

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

                      1. <tfoot id='GLEZk'></tfoot>
                          • <bdo id='GLEZk'></bdo><ul id='GLEZk'></ul>
                          • 主站蜘蛛池模板: 91精品国产综合久久福利软件 | 激情婷婷 | 欧美日韩国产一区二区三区 | 国产精品永久久久久 | 中文字幕亚洲一区二区三区 | 一区二区免费 | 日韩高清一区二区 | 三级国产三级在线 | 国产区精品在线观看 | aa级毛片毛片免费观看久 | 伊人伊成久久人综合网站 | 操久久| 欧美一区二区三区在线播放 | 久久精品国产一区老色匹 | 一级在线免费观看 | 成人精品在线视频 | 日操操 | 国产电影一区二区三区爱妃记 | 黄色精品 | 一区二区视频 | 欧美久久久 | h片在线观看网站 | 亚洲成人网在线播放 | 91精品国产91久久久久久三级 | 国色天香综合网 | 在线观看视频你懂得 | 日一区二区三区 | 国产在线中文字幕 | 美女视频一区二区 | 久久中文字幕一区 | 国产成人精品一区二区三区视频 | 欧美午夜视频 | 日韩成人在线播放 | 在线观看亚洲精品视频 | 天天躁人人躁人人躁狂躁 | 91热在线 | 一级黄色裸片 | www.国产.com | 一级h片 | 国产午夜精品一区二区三区在线观看 | 久久精品99 |