You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Ralf Schneider <ra...@tapfere-schneiderleins.de> on 2004/07/20 15:58:34 UTC

Multiple Resource Bundles

Hi,

I try to use multiple resource bundles that get the strings from a database in 
an environment using JBoss, Struts and Velocity.

I have defined two <message-resources> in struts-config.xml:

  <message-resources
    	factory="com.bk.web.struts.BKWebStringResourceFactory"
    	parameter="StringResources"
    	key="Strings"/>
  <message-resources
    	factory="com.bk.web.struts.BKWebMessageResourceFactory"
    	parameter="ApplicationResources"/>

During startup of JBoss the createResource() method of both factories is 
called.

But when I call a page on which the strings come from the StringResources 
bundle the getMessage() method of the ApplicationResources bundle is called. 
In the HTML code I've placed calls like this (:

	$msg.get("global.close", "StringResources")

msg is defined in toolbox.xml:

  <tool>
     <key>msg</key>
     <class>org.apache.velocity.tools.struts.MessageTool</class>
  </tool>

What's wrong with my call of $msg.get()? Did I miss anything?

Best regards,
Ralf.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org