码迷,mamicode.com
首页 > 其他好文 > 详细

为应用指定多个struts配置文件

时间:2018-04-06 22:34:45      阅读:139      评论:0      收藏:0      [点我收藏+]

标签:enc   bsp   type   AC   分解   user   public   多个   应用   

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

 

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
    "-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
    "http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
    <include file="struts-user.xml"/>
    <include file="struts-order.xml"/>
</struts>

通过这种方式,我们就可以将Struts 2的Action按模块添加在多个配置文件中。

为应用指定多个struts配置文件

标签:enc   bsp   type   AC   分解   user   public   多个   应用   

原文地址:https://www.cnblogs.com/feifeicui/p/8728793.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!