struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Susan Bradeen" <Sus...@softlanding.com>
Subject Re: multi-user development
Date Mon, 07 Jul 2003 18:06:26 GMT
On 07/07/2003 01:34:44 PM "Gregory F. March" wrote:

> I am about to allow others to work on my project now that I've set up
> much of the framework.
> 
> I can see a few problems, most notable is the struts-config.xml file.  I
> believe there will be much contention for this file.
> 
> I seem to recall a discussion about splitting this file up into multiple
> config files, but it appears that the search facility on the
> apache/struts site is down.
> 
> Is splitting the config file possible?  If so, how?

Yes. Use a comma-delimited list something like this in your web.xml:

 <servlet>
   <servlet-name>action</servlet-name>
   <servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
   <init-param>
     <param-name>config</param-name>
     <param-value>/WEB-INF/struts-config.xml,/WEB-INF/struts-config-apple.xml,
        /WEB-INF/struts-config-orange.xml,/WEB-INF/struts-config-pear.xml
      </param-value>
   </init-param>
 <load-on-startup>1</load-on-startup>
 </servlet>

> 
> Also, assuming the above is possible, what are others doing for this?
> I.e., do you have multiple config files based on modules in your app?
> For example, I assume the way *not* to do this would be to have an
> "action-config.xml" file, but rather a "functional-area1.xml" file.

Yes exactly, functional areas is why we separate the config definitions. 
Purely for maintenance reasons ... so you can actually find something 
quickly. I do not use modules.
 
> But, this assumes you can have multiple tags/sections for things like
> global-forwards and action-mappings.  Can you?
> 

You can put globals and action mappings in any config file and your 
application will find it. Basically it becomes one big config file in the 
end. I usually put all globals in the traditional struts-config.xml, then 
use the other config files for anything local to the functional area. 
Whatever makes sense for you. One note, the last definition wins. If a 
global attribute or an action mapping have duplicate names in two or more 
config files, the one farthest down the config file list will be used. 
(For example in the above list something defined in struts-config-pear 
will replace something with the same name in struts-config-apple.) 

Not sure how all this might differ if you were using modules.

Hope that helps,
Susan Bradeen

> Any insight would be really appreciated.
> 
> Thanks!
> 
> /greg
> 
> --
> Gregory F. March    -=-    http://www.gfm.net:81/~march    -=- 
AIM:GfmNet
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: struts-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: struts-user-help@jakarta.apache.org
> 

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


Mime
View raw message