美文网首页
08. struts2中为应用指定多个struts配置文件

08. struts2中为应用指定多个struts配置文件

作者: c9096743e3b0 | 来源:发表于2020-12-04 00:49 被阅读0次

概述

  • 随着应用规模的增加,系统中Action的数量也会大量增加,导致struts.xml配置文件变得非常臃肿
  • 为了避免struts.xml文件过于庞大、臃肿,提高Struts.xml文件的可读性,我们可以将一个struts.xml配置文件分解成多个配置文件
  • 然后再struts.xml文件中包含其他配置文件

操作

  • 通过<include>元素指定多个配置文件

    •  <struts>
           <include file="department.xml"/> 一个模块使用一个配置文件
           <include file="employee.xml"/>
       </struts>
      
  • 通过这种方式,可以将struts2的Action按模块添加到多个配置文件中

相关文章

网友评论

      本文标题:08. struts2中为应用指定多个struts配置文件

      本文链接:https://www.haomeiwen.com/subject/ancbwktx.html