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

        <tfoot id='tNzrA'></tfoot>
        • <bdo id='tNzrA'></bdo><ul id='tNzrA'></ul>

        <legend id='tNzrA'><style id='tNzrA'><dir id='tNzrA'><q id='tNzrA'></q></dir></style></legend>
      1. <i id='tNzrA'><tr id='tNzrA'><dt id='tNzrA'><q id='tNzrA'><span id='tNzrA'><b id='tNzrA'><form id='tNzrA'><ins id='tNzrA'></ins><ul id='tNzrA'></ul><sub id='tNzrA'></sub></form><legend id='tNzrA'></legend><bdo id='tNzrA'><pre id='tNzrA'><center id='tNzrA'></center></pre></bdo></b><th id='tNzrA'></th></span></q></dt></tr></i><div id='tNzrA'><tfoot id='tNzrA'></tfoot><dl id='tNzrA'><fieldset id='tNzrA'></fieldset></dl></div>
      2. 只要用户在当前会话中,就防止调用两次相同的操作

        时间:2023-09-24

                <tbody id='ugYGb'></tbody>

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

              <i id='ugYGb'><tr id='ugYGb'><dt id='ugYGb'><q id='ugYGb'><span id='ugYGb'><b id='ugYGb'><form id='ugYGb'><ins id='ugYGb'></ins><ul id='ugYGb'></ul><sub id='ugYGb'></sub></form><legend id='ugYGb'></legend><bdo id='ugYGb'><pre id='ugYGb'><center id='ugYGb'></center></pre></bdo></b><th id='ugYGb'></th></span></q></dt></tr></i><div id='ugYGb'><tfoot id='ugYGb'></tfoot><dl id='ugYGb'><fieldset id='ugYGb'></fieldset></dl></div>
              <tfoot id='ugYGb'></tfoot>
            1. <legend id='ugYGb'><style id='ugYGb'><dir id='ugYGb'><q id='ugYGb'></q></dir></style></legend>
                <bdo id='ugYGb'></bdo><ul id='ugYGb'></ul>
                  本文介绍了只要用户在当前会话中,就防止调用两次相同的操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我用的是Struts2框架,我的问题是

                  I am using Struts2 framework, my problem is

                  如果用户登录系统并点击了一些动作,比如说ACTION1,流程将进入动作类并执行一些方法,返回适当的结果.他可能会访问一些网页,然后再次点击ACTION1.

                  If user log-in into system and clicked some action lets say ACTION1, flow will go to action class and executes some method, return appropriate result. He may visit some of the web pages, and again clicked ACTION1.

                  只要他在同一个会话中,现在控件不应该去那个特定的方法,但结果应该和以前的结果一样.

                  As long as he is in the same session, now the control should not go that particular method but the result should be same as previous results.

                  我们怎样才能做到这一点?

                  How can we achieve this?

                  推荐答案

                  你可以试试 tokenSession 拦截器.

                  You can try a tokenSession interceptor.

                  此拦截器基于 token 拦截器构建,提供处理无效令牌的高级逻辑.与普通令牌不同拦截器,此拦截器将尝试提供智能在使用同一会话的多个请求的情况下进行故障转移.也就是说,它会阻塞后续请求,直到第一个请求被完成,然后不是返回 invalid.token 代码,而是将尝试显示与原始有效的相同响应如果没有多个请求,则将显示操作调用首先提交.

                  This interceptor builds off of the token interceptor, providing advanced logic for handling invalid tokens. Unlike the normal token interceptor, this interceptor will attempt to provide intelligent fail-over in the event of multiple requests using the same session. That is, it will block subsequent requests until the first request is complete, and then instead of returning the invalid.token code, it will attempt to display the same response that the original, valid action invocation would have displayed if no multiple requests were submitted in the first place.

                  它将防止重复提交相同的操作或重复使用您通过 s:token 标签.

                  It will prevent from double submit the same action or reuse the same token that you provide with s:token tag.

                  说明

                  停止重复提交表单.

                  令牌标签用于帮助双击";提交问题.如果您使用 TokenInterceptorTokenSessionInterceptor.s:token 标签只是放置一个隐藏的包含唯一标记的元素.

                  The token tag is used to help with the "double click" submission problem. It is needed if you are using the TokenInterceptor or the TokenSessionInterceptor. The s:token tag merely places a hidden element that contains the unique token.

                  将标签放在您的表单中,您再也不会重复提交同一个表单了.令牌会话拦截器将尝试通过返回与第一种情况相同的响应来为您处理无效令牌.

                  Place the tag inside your form and you never get back in submitting the same form twice. Token session interceptor will try to handle invalid token for you by returning the same response like in first case.

                  这篇关于只要用户在当前会话中,就防止调用两次相同的操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:如何通过 POST (Ajax) 发送 JSON 数据并从 Struts 2 操作接收 JSON 响应 下一篇:如何将值从 javascript 传递到 struts2 中的 java 类?

                  相关文章

                  <tfoot id='EEFAl'></tfoot>

                      <bdo id='EEFAl'></bdo><ul id='EEFAl'></ul>
                      <legend id='EEFAl'><style id='EEFAl'><dir id='EEFAl'><q id='EEFAl'></q></dir></style></legend>
                    1. <small id='EEFAl'></small><noframes id='EEFAl'>

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