• <legend id='xs8ml'><style id='xs8ml'><dir id='xs8ml'><q id='xs8ml'></q></dir></style></legend>

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

    <tfoot id='xs8ml'></tfoot>

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

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

        将多个动作映射到同一个类struts 2.3是最佳实践吗

        Is it best practice to map multiple actions to the same class struts 2.3(将多个动作映射到同一个类struts 2.3是最佳实践吗)
        <legend id='SLb0d'><style id='SLb0d'><dir id='SLb0d'><q id='SLb0d'></q></dir></style></legend>
            <bdo id='SLb0d'></bdo><ul id='SLb0d'></ul>
              <tfoot id='SLb0d'></tfoot>
                <tbody id='SLb0d'></tbody>

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

              1. <i id='SLb0d'><tr id='SLb0d'><dt id='SLb0d'><q id='SLb0d'><span id='SLb0d'><b id='SLb0d'><form id='SLb0d'><ins id='SLb0d'></ins><ul id='SLb0d'></ul><sub id='SLb0d'></sub></form><legend id='SLb0d'></legend><bdo id='SLb0d'><pre id='SLb0d'><center id='SLb0d'></center></pre></bdo></b><th id='SLb0d'></th></span></q></dt></tr></i><div id='SLb0d'><tfoot id='SLb0d'></tfoot><dl id='SLb0d'><fieldset id='SLb0d'></fieldset></dl></div>
                • 本文介绍了将多个动作映射到同一个类struts 2.3是最佳实践吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我正在用选项(添加、删除、修改、打印)在 struts 中开发联系人管理器.

                  I am developing contact manager in struts with options(add,delete,modify,print).

                  我正在考虑将多个动作(将多个动作映射到同一个类 struts 2.3)映射到同一个类(ContactManager).

                  I am thinking to map multiple actions(map multiple actions to the same class struts 2.3) to the same class(ContactManager).

                  我想知道它是否正确或者是否需要为每个动作编写单独的动作?

                  I want to know whether it is correct or whether there is need to write separate action for each action?

                  推荐答案

                  一个好方法,imho ,就是为你必须做的每一个动作使用一个动作执行,每个都扩展其最后一个分叉的父操作,例如:

                  One good way to go, imho , is to use one Action for every action you have to perform, each one extending its last-forked parent Actions, like:

                  BaseAction
                  |
                  |----------BaseReportAction
                  |          |----- ExcelReportAction
                  |          |----- PDFReportAction
                  |          |----- CSVReportAction
                  |
                  |
                  |----------BaseCRUDAction
                  |          |----- CreateAction
                  |          |----- ReadAction
                  |          |----- UpdateAction
                  |          |----- DeleteAction
                  |
                  |
                  |----------BaseAJAXAction
                  |          |----- ReadSessionCountdownAction
                  |          |----- CheckNewMailsAction
                  |
                  

                  等等……

                  其他人扩展的每个Action都会将protected属性/方法分享给孩子.

                  Every Action extended by others will share protected attributes / methods to the children.

                  看看这个:在Struts 2中绑定后更改参数

                  我的 2 美分.

                  这篇关于将多个动作映射到同一个类struts 2.3是最佳实践吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 中的默认语言环境设置以使其保持一致?)
                    <bdo id='dLMAl'></bdo><ul id='dLMAl'></ul>
                    <legend id='dLMAl'><style id='dLMAl'><dir id='dLMAl'><q id='dLMAl'></q></dir></style></legend>

                      <tfoot id='dLMAl'></tfoot>

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

                        <tbody id='dLMAl'></tbody>

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