【问题标题】:Struts2 same namespaces in different struts.xml files不同struts.xml文件中的Struts2相同命名空间
【发布时间】:2011-07-01 08:13:57
【问题描述】:

是否可以在不同的 struts.xml 文件中使用相同的命名空间?我知道我们可以使用不同的命名空间。问题是,我的配置文件中有很多操作。我只是想分开以便于管理。但是如果我为每个文件使用不同的命名空间,我必须修改到处提到的命名空间(JSP)。

例如。

我想在我的所有 struts.xml 文件中使用 namespace="/"

我希望你明白我要说什么。这是否可能或任何其他相关的简单方法来实现这一目标?

提前致谢

【问题讨论】:

    标签: struts2 struts2-namespace


    【解决方案1】:

    您绝对可以使用具有相同命名空间的多个包。请记住,包不能具有相同的名称。您还需要将它们全部包含在您的主 struts.xml 中,例如:

    <include file="path to your config files"/>
    

    【讨论】:

    • 感谢您的回复。会试试看。
    【解决方案2】:
    <struts>
    
        <!-- Other information goes here -->     
        <include file = "Administrator-Config.xml"/>
        <include file = "CustomerConfig.xml"/>
        <include file = "EmployerConfig.xml"/>  
        <!-- Other information goes here -->
    
    </struts>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-17
      • 1970-01-01
      • 2012-07-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-09-16
      • 1970-01-01
      相关资源
      最近更新 更多