struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Husted" <hus...@apache.org>
Subject [S2 Tip] Place each namespace into its own Struts configuration file
Date Fri, 30 Mar 2007 13:16:32 GMT
The framework configuration supports an include element. When using
packages and namespaces to organize an application, each namespace can
be placed into its own configuration file, and then included by the
default struts.xml configuration file.

<struts>

    <constant name="struts.devMode" value="false" />

    <include file="struts-chat.xml" />

    <include file="struts-hangman.xml" />

    <!-- ... ->

</struts>

Maintaining a separate configuration file for each module reduces
coupling and increases cohesion. If different members of a team are
workinmg on different segments of the application (or "module"), each
group can maintain the configuration file relating to their segment.

Note that configuration packages can extend one another.

<struts>
    <package name="mailreader-support" namespace="/"
extends="mailreader-default">

    <!-- ... -->
<struts>

Common configuration settings can be placed into a default file and
shared between packages.

HTH, Ted.
<http://www.husted.com/ted/blog/>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Mime
View raw message