You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Josh Holtzman <jh...@americandatacompany.com> on 2004/04/26 05:57:16 UTC

Accessing MessageResource Objects from across Application Modules.

Hello,
 
I've been scouring through the archives for some direction on this but can
not seem to find an answer.
 
Any suggestions are greatly appreciated.
 
I have a custom JSP Tag that within the source code accesses the
MessageResource object with the following line of code.
 
MessageResources messages = (MessageResources) request.getAttribute(
org.apache.struts.Globals.MESSAGES_KEY );
 
When I use this tag from within the default Struts application module this
code successfully retrieves the default MessageResources object.
 
I have created an additional application module called "/extranet".  When I
use this custom tag within the /extranet module, the MessageResource lookup
stated above returns null. If I understand the javadocs correctly, it states
that the default Message resources are stored with the Globals.MESSAGES_KEY
and the concatenation of the name of the application module the
MessageResources are located.  In my case I want to retrieve the
MessageResources from the default application, so, I haven't appended
anything to the end of the key.  I have also tried appending "/" and
"/extranet" to the end of the key when I perform the lookup, and I still
receive null.
 
Once again, and light you can shed on how to correct this would be of
significant assistance.
 
Best regards to all.
 
Josh Holtzman

American Data Company

jholtzman@americandatacompany.com

Voice: (310) 470-1257

Fax:    (310) 362-8454

 

Sun Microsystems iForce Partner