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

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

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

        如何在 Struts 2 中以单一形式处理多个动作

        How to handle multiple actions in a single form in Struts 2(如何在 Struts 2 中以单一形式处理多个动作)

        • <legend id='JIEG5'><style id='JIEG5'><dir id='JIEG5'><q id='JIEG5'></q></dir></style></legend>
            <tbody id='JIEG5'></tbody>
              1. <tfoot id='JIEG5'></tfoot>
                <i id='JIEG5'><tr id='JIEG5'><dt id='JIEG5'><q id='JIEG5'><span id='JIEG5'><b id='JIEG5'><form id='JIEG5'><ins id='JIEG5'></ins><ul id='JIEG5'></ul><sub id='JIEG5'></sub></form><legend id='JIEG5'></legend><bdo id='JIEG5'><pre id='JIEG5'><center id='JIEG5'></center></pre></bdo></b><th id='JIEG5'></th></span></q></dt></tr></i><div id='JIEG5'><tfoot id='JIEG5'></tfoot><dl id='JIEG5'><fieldset id='JIEG5'></fieldset></dl></div>
              2. <small id='JIEG5'></small><noframes id='JIEG5'>

                  <bdo id='JIEG5'></bdo><ul id='JIEG5'></ul>
                • 本文介绍了如何在 Struts 2 中以单一形式处理多个动作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我有一个表单包含三个按钮print/export/save.

                  I have a form contains three buttons print/export/save.

                  <s:form action="/userAction">
                      <s:submit type="image" value="%{'print'}" src="/print.png" />
                      <s:submit type="image" value="%{'export'}" src="/export.png" />
                      <s:submit type="image" value="%{'save'}" src="/save.png" />
                  </s:form>
                  

                  如何在 struts.xml 中映射它?

                  推荐答案

                  struts.xml 中,动作通过 action 标签

                  In the struts.xml the action is mapped via the action tag

                  <action name="userAction" class="...
                  

                  submit 按钮应该包含 method 属性来调用相应的动作方法

                  the submit buttons should include method attribute to call corresponding methods of the action

                  <s:submit type="image" value="%{'print'}" src="/print.png" method="print" />
                  <s:submit type="image" value="%{'export'}" src="/export.png" method="export" />
                  <s:submit type="image" value="%{'save'}" src="/save.png" method="save" />
                  

                  注意:要映射 method 属性,您应该具有 DMI 开启.

                  Note: To map a method attribute you should have DMI turned on.

                  这篇关于如何在 Struts 2 中以单一形式处理多个动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  How to send data to COM PORT using JAVA?(如何使用 JAVA 向 COM PORT 发送数据?)
                  How to make a report page direction to change to quot;rtlquot;?(如何使报表页面方向更改为“rtl?)
                  Use cyrillic .properties file in eclipse project(在 Eclipse 项目中使用西里尔文 .properties 文件)
                  Is there any way to detect an RTL language in Java?(有没有办法在 Java 中检测 RTL 语言?)
                  How to load resource bundle messages from DB in Java?(如何在 Java 中从 DB 加载资源包消息?)
                  How do I change the default locale settings in Java to make them consistent?(如何更改 Java 中的默认语言环境设置以使其保持一致?)

                    <legend id='nEt5K'><style id='nEt5K'><dir id='nEt5K'><q id='nEt5K'></q></dir></style></legend>
                      <tbody id='nEt5K'></tbody>
                  1. <small id='nEt5K'></small><noframes id='nEt5K'>

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

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