struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas CORNET <tho...@cornet.name>
Subject Re: Sharing resources among multiple Struts modules
Date Fri, 07 Mar 2003 18:45:22 GMT


    Don't worry, it's possible since struts 1.1 :)

    Two steps are needed :

a) in your struts-config.xml file (default module), you can declare several 
ressources files

         <message-resources parameter="default" />
         <message-resources parameter="buttons" key="btn" />
         <message-resources parameter="images" key="img" />

in this example, you declare three ressources files, which are identified 
by the key parameter.

b) in your JSPs, just access them

         <bean:message bundle="img" key="image.bowl" />

     just specify the bundle parameter to let struts access the right 
properties files.


If you define several ressources in your default module, all of them will 
be accessible by your modules.


                  Thomas


BTW, has anyone succeeded in defining several resources files in the config 
of a module ?? I tried, but it doesn't seem to identify the bundle I 
provide in my JSPs...




At 16:47 07/03/2003, you wrote:
>Hi,
>
>I'm working on an application where there are muliple Struts modules. In
>each struts config file there is a <message-resources> element with
>parameter set to a property file containing resources for the module.
>However, there are a number of properties that are common to all the
>modules.
>
>Is is possible for each module to access multiple resource property files so
>that common properties can be put into a single file which is then shared? I
>haven't figured out how to do this so I've had to use a single property file
>for all the modules which makes the file large and hard to share between
>developers. If this is necessary, it seems to defeat some of the advantages
>of using modules.
>
>Thanks,
>
>Al
>
>This transmission is intended only for use by the addressee(s) named 
>herein and may contain information that is proprietary, confidential 
>and/or legally privileged. If you are not the intended recipient, you are 
>hereby notified that any disclosure, copying, distribution, or use of the 
>information contained herein (including any reliance thereon) is STRICTLY 
>PROHIBITED. If you received this transmission in error, please immediately 
>contact the sender and destroy the material in its entirety, whether in 
>electronic or hard copy format. Thank you.
>
>---------------------------------------------------------------------
>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