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

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

      1. <small id='2kQqZ'></small><noframes id='2kQqZ'>

        <tfoot id='2kQqZ'></tfoot>

        如何在 Struts2 應(yīng)用程序中為 AJAX 請求做 CSRF 保護

        HOWTO do CSRF protection in Struts2 application for AJAX requests(如何在 Struts2 應(yīng)用程序中為 AJAX 請求做 CSRF 保護)
          <bdo id='IE761'></bdo><ul id='IE761'></ul>
              <tbody id='IE761'></tbody>
          • <i id='IE761'><tr id='IE761'><dt id='IE761'><q id='IE761'><span id='IE761'><b id='IE761'><form id='IE761'><ins id='IE761'></ins><ul id='IE761'></ul><sub id='IE761'></sub></form><legend id='IE761'></legend><bdo id='IE761'><pre id='IE761'><center id='IE761'></center></pre></bdo></b><th id='IE761'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='IE761'><tfoot id='IE761'></tfoot><dl id='IE761'><fieldset id='IE761'></fieldset></dl></div>

            1. <legend id='IE761'><style id='IE761'><dir id='IE761'><q id='IE761'></q></dir></style></legend>
            2. <tfoot id='IE761'></tfoot>

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

                  本文介紹了如何在 Struts2 應(yīng)用程序中為 AJAX 請求做 CSRF 保護的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  我有一個 struts2 webapp,我需要在其中實現(xiàn) CSRF 保護.對于統(tǒng)計表格,它非常簡單.我只需要激活 tokenSession 攔截器 &然后在要提交的表單中設(shè)置.(在 這里 和 這里)

                  I have a struts2 webapp in which I need to implement CSRF protection. For statis forms it is pretty straight forward. I just need to activate the tokenSession interceptor & then set <s:token/> in the form to be submitted. (explained here and here)

                  但是當我需要為不一定通過表單提交的 POST AJAX 調(diào)用(我使用的是 jQuery)啟用 CSRF 保護時,就會出現(xiàn)問題.在進行后續(xù) AJAX 調(diào)用時,我面臨重復(fù)使用令牌的問題.

                  But the problem appears when I need to enable CSRF protection for POST AJAX calls (I am using jQuery) which are not necessarily submitted via forms. I face the issue of re-using token when making subsequent AJAX calls.

                  感謝任何指針或不同的方法.

                  Any pointers or different approaches are appreciated.

                  推薦答案

                  目前我已經(jīng)通過為 AJAX 請求生成令牌并像這樣以正常響應(yīng)發(fā)送它來解決問題 -

                  Currently I have resolved the issue by generating tokens for AJAX requests and sending it with the normal response like so -

                      Map<String, String> tokenInfo = Maps.newHashMap();
                      tokenInfo.put("struts.token.name", TokenHelper.getTokenName());
                      tokenInfo.put(TokenHelper.getTokenName(), TokenHelper.setToken());
                  

                  我將從這個 & 中抽象出一個 util 方法.讓被令牌激活的操作將其作為響應(yīng)的一部分返回,這些操作將在不刷新頁面的情況下重復(fù)執(zhí)行.

                  I will abstract out a util method out of this & have the Actions that are token-activated to return this as part of response for actions which will be executed repeatedly without refresh of the page.

                  不過,我仍在尋找一個優(yōu)雅的解決方案.

                  I am still looking for an elegant solution to this though.

                  這篇關(guān)于如何在 Struts2 應(yīng)用程序中為 AJAX 請求做 CSRF 保護的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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)用完成)
                  XMLHttpRequest cannot load, No #39;Access-Control-Allow-Origin#39; header is present on the requested resource(XMLHttpRequest 無法加載,請求的資源上不存在“Access-Control-Allow-Origin標頭) - IT屋-程序員軟件開發(fā)技術(shù)分
                  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 部分內(nèi)容)
                  XmlHttpRequest onprogress interval(XmlHttpRequest onprogress 間隔)

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

                    <bdo id='C9FPS'></bdo><ul id='C9FPS'></ul>

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

                            <tbody id='C9FPS'></tbody>
                        2. <legend id='C9FPS'><style id='C9FPS'><dir id='C9FPS'><q id='C9FPS'></q></dir></style></legend>

                          • 主站蜘蛛池模板: 亚洲免费人成在线视频观看 | 国产精品视频偷伦精品视频 | 欧美国产日韩在线 | 婷婷毛片| 久久久久久国产精品免费免费狐狸 | av免费观看在线 | 精品亚洲一区二区三区 | 日日网| 久久午夜视频 | 久久岛国 | 国产欧美一区二区三区另类精品 | 国产乱码精品一区二区三区忘忧草 | 就操在线 | 成年人视频免费在线观看 | 亚洲精品久久久9婷婷中文字幕 | 久久中文字幕一区 | 国产91久久久久蜜臀青青天草二 | 欧美极品少妇xxxxⅹ免费视频 | 亚洲精品日韩精品 | 在线观看国产精品一区二区 | 一区二区三区视频在线免费观看 | 91 在线| 日日夜夜免费精品视频 | 9999视频| 国产欧美日韩综合精品一区二区 | 国内精品久久久久久影视8 最新黄色在线观看 | 国产小视频自拍 | 免费黄色av网站 | 亚洲国产欧美一区二区三区久久 | 成人av免费播放 | 干狠狠| 日韩一区二区三区在线观看 | 国产精品久久久久久久久久久久 | 久久免费精品 | 五月婷婷丁香 | 天天操夜夜艹 | 国产网站在线免费观看 | 国产精品一区二区在线观看 | 一级片子 | 久久久精品高清 | 久久精品亚洲精品 |