I find having multiple struts-config files helps considerably to manage a large project, but I find that the module development model generally doesn't suit my applications, so I do what Viral is trying to do all the time.
Furthermore, whitespace and leading slashes are not a problem: Here's what I have in one project:
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/struts-config.xml,
/WEB-INF/library/struts-config.xml, /WEB-INF/image/struts-config.xml, /WEB-INF/reporting/struts-config.xml, /WEB-INF/offer/struts-config.xml, /WEB-INF/configure/struts-config.xml, /WEB-INF/customizeflow/struts-config.xml, /WEB-INF/preferences/struts-config.xml, /WEB-INF/help/struts-config.xml, /WEB-INF/group/struts-config.xml, /WEB-INF/media/struts-config.xml, /WEB-INF/deliver/struts-config.xml,
/WEB-INF/dealer/struts-config.xml,
/WEB-INF/agency/struts-config.xml,
/WEB-INF/planner/struts-config.xml,
/WEB-INF/coop/struts-config.xml,
/WEB-INF/proxy/struts-config.xml,
/WEB-INF/training/struts-config.xml,
/WEB-INF/contentmgmt/struts-config.xml
</param-value>
</init-param>
All those spaces and newlines are ignored. This is in Struts 1.2, but I believe this functionality goes back a ways.
By the way, for those thinking about using this, I find using directories instead of merely unique file names helps keep things organized. It gives you a place to put related Validator and Tiles config files (both of which also support any number of config files) and I like to be able to do searches across all files named "struts-config.xml" (like this morning when I found another developer had defined a global exception handler which was overriding the exception config I had put in the first struts-config file.)
I've never had a problem with this, so I'm not sure what to suggest, but I can tell you that it will work.
Joe
At 3:50 PM +0530 9/22/04, Ashutosh Satyam wrote:
By any chance are you trying to map both these struts file as same input parameter.
Better try this, <init-param> <param-name>config</param-name> <param-value>/WEB-INF/resr-fin-struts-config.xml</param-value> </init-param> <init-param> <param-name>config/app2</param-name> <param-value>/WEB-INF/resr-tam-struts-config.xml</param-value> </init-param>
You will be able to access action classes for your 2nd struts-config as mentioned below http://localhost/app2/YourActionClass.do
Hope this helps.
- Ashutosh
-----Original Message----- From: Mark Benussi [mailto:[EMAIL PROTECTED] Sent: Wednesday, September 22, 2004 3:42 PM To: [EMAIL PROTECTED] Subject: RE: multiple struts-config error
I woud remove the preceeding / and any space between entries.
----Original Message Follows---- From: "Viral_Thakkar" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Subject: multiple struts-config error Date: Wed, 22 Sep 2004 15:21:21 +0530
When I am tring to use multiple struts-config xml files in web.xml, I get below error on click of an action.
503 Service Unavailable
Servlet error: Parsing error processing resource path /WEB-INF/resr-fin-struts-config.xml, /WEB-INF/resr-tam-struts-config.xml
Any input ..???
Regards,
Viral
--------------------------------------------------------------------- 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]
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com "In fact, when I die, if I don't hear 'A Love Supreme,' I'll turn back; I'll know I'm in the wrong place."
- Carlos Santana