• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

multiple struts-config files

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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" />.
 
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for your help Merrill. Greatly appreciated.
 
this llama doesn't want your drama, he just wants this tiny ad for his mama
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic