• <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 中以单一形式处理多个动作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  Java Bytecode Manipulation Library Suggestions(Java 字节码操作库建议)
                  Java CLI UI-design: frameworks or libraries?(Java CLI UI 设计:框架还是库?)
                  About the use of Beans.xml configuration file in Spring Framework application(关于Spring Framework应用中Beans.xml配置文件的使用)
                  What is the difference between Spring, Struts, Hibernate, JavaServer Faces, Tapestry?(Spring、Struts、Hibernate、JavaServer Faces、Tapestry 有什么区别?)
                  Are there any android application framework like spring?(有没有像spring这样的android应用程序框架?)
                  Java Swing based game framework. Any advice?(基于 Java Swing 的游戏框架.有什么建议吗?)

                    <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>