struts2中配置多个struts.xml配置文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了struts2中配置多个struts.xml配置文件相关的知识,希望对你有一定的参考价值。

一般来说我们在做开发的时候,是一个团队,我们可能会按照人来分不同的模块,每个人维护自己不同的struts配置文件,但在最后整合的时候,一定要把各人所用到的配置文件都整合进来,这里有一个方法,用是在你写的主要的配置文件中把别的配置文件导进来.

在struts.xml中加入下面的文字就可以解决了

<include file="struts-default.xml">

< include file="struts_helei.xml" />

<include file="struts_zou.xml" /><include file="struts-default.xml">

<include file="struts_helei.xml"><include file="struts_zou.xml"><include file="struts-default.xml">

<include file="struts_helei.xml">

<include file="struts_zou.xml"></include></include></include></include></include></include><include file="struts-default.xml">

<include file="struts_helei.xml">

<include file="struts_zou.xml"></include></include>

</include><include file="struts_mu.xml"></include>

技术分享:www.kaige123.com

以上是关于struts2中配置多个struts.xml配置文件的主要内容,如果未能解决你的问题,请参考以下文章

Struts2系列:使用多个struts配置文件

struts2中struts.xml配置文件详解未整理

struts2中struts.xml配置文件详解未整理

Struts2项目搭建之struts.xml配置

struts2 配置文件

Struts2配置拦截器,struts2加载常量时的搜索顺序