I would caution anyone about using Modules. It is not for the beginner. Working with Struts Modules can be extremely confusing to the novice Struts developer. I think a better solution is to suggest that they use multi config, but make sure they use a common pattern between multiple config xml files.

So, in struts-config-client.xml, all mappings would be like <action path="/Client/Foo" ...
And in struts-config-employee.xml, all mapping would be like <action path="Employee/Bar" ...
And for commonly shared things like login or whatever, you could have a struts-config-common.xml with <action path="/Common/Baz"


The same style of naming would apply for other entries, like action forms, global forward, and the rest.



--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
678.910.8017
AIM:   jmitchtx
Yahoo: jmitchtx
MSN:   [EMAIL PROTECTED]




----- Original Message ----- From: "Manfred Wolff" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <user@struts.apache.org>
Sent: Monday, April 11, 2005 2:48 AM
Subject: Re: Multiple struts-config.xml




Hi

A better way is to use struts modules. Every Module has its own struts-configuration. If you use more than one struts configuration such as described below, you may have problems with duplicate identifiers, becaus struts builds one configuration out of all files. This problems you don't have using modules. Modules acts as a namespace in this case.

-Manfred

--

===========================================
Dipl.-Inf. Manfred Wolff
Software Engineer
-------------------------------------------
http://www.manfred-wolff.de
http://www.struts-it.org
-------------------------------------------


Folashade Adeyosoye wrote:

Yes, in your web.xml


Change this...

 <servlet>
   <servlet-name>AppName</servlet-name>
   <servlet-class>com.path.to.the.ActionServlet</servlet-class>
   <init-param>
     <param-name>config</param-name>
     <param-value>/WEB-INF/struts-config.xml</param-value>
   </init-param>
   <load-on-startup>1</load-on-startup>
 </servlet>

To

 <servlet>
   <servlet-name> AppName </servlet-name>
   <servlet-class>com.path.to.the.ActionServlet</servlet-class>
   <init-param>
     <param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml,/WEB-INF/the-employee-config.xml,/WE
B-INF/the-admin-config.xml,/WEB-INF/the-client-config.xml,/WEB-INF/the-billi
ng-config.xml,/WEB-INF/the-report-config.xml,/WEB-INF/the-patient-config.xml
</param-value>
   </init-param>
   <load-on-startup>1</load-on-startup>
 </servlet>


-----Original Message-----
From: Néstor Boscán [mailto:[EMAIL PROTECTED] Sent: Sunday, April 10, 2005 11:04 PM
To: 'Struts Users Mailing List'
Subject: Multiple struts-config.xml


Hi
I have an application and I need to create many web flows. If I use struts
to model the web flows, is it possible to use many struts-config.xml instead
of one?
Regards,
Néstor Boscán



--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]





--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to