• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

multiple struts-config files

 
jakes vandenberg
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a struts based project (domain, ear, web) that I need to integrate with an existing project. This means that there will be multiple strut-config files, multiple ApplicationResources, etc.

Anyone done this before? What should I be concerned about? What about duplicate entries in both the struts-config files?

Any help is much appreciated.

Thanks
Jakes
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There are two different ways to go here:

1-Create two different modules, each with their own Struts-config file and ApplicationResources file. This allows each module to have a degree of autonomy. This means it doesn't matter if both config files specify the same action path or action form name. Struts will still keep them straight.

2-Keep the applicaion as a single module with two config files. This will work, but if there are duplicate entries, the rule is the last entry wins, meaning that the one that is read last by the init process will be the one that is used. Also, while you can have more than one resource bundle file, you cannot have more than one default resource bundle. This means that the second and any subsequent resource files have to be defined with a key attribute, and referenced with a bundle attribute. Example:

<bean:message bundle="seconndbundle" key="mykey" />.
 
Seetesh Hindlekar
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Pls refer to my post for multiple resource files in one struts-config.xml.

Rgds,

Seet
 
jakes vandenberg
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I use the Application resources property file for error messages that I use to create and populate ActionMessages in my action. How do I tell it in the Action which property file to use??
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't. Unfortunately, there's no way to specify a non-default message resource when creating error messages.

The only way around this would be to write your own extensions to Struts.
[ October 20, 2006: Message edited by: Merrill Higginson ]
 
jakes vandenberg
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your help Merrill. Greatly appreciated.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic