struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ted Husted" <>
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.


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

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

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

    <!-- ... ->


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.

    <package name="mailreader-support" namespace="/"

    <!-- ... -->

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

HTH, Ted.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message