Or you could just use:

MessageResources bundle = this.getResources();


Ian

Ian D. Stewart
Open Systems Engineer II
Enterprise Midrange - Bank One Infrastructure & Operations
[EMAIL PROTECTED]
(614) 213-6100




Kevin Robair <[EMAIL PROTECTED]> on 06/09/2003 09:53:29 AM

Please respond to "Struts Users Mailing List"
      <[EMAIL PROTECTED]>

To:   Struts Users Mailing List <[EMAIL PROTECTED]>
cc:

Subject:  Re: Accessing ApplicationResources.properties



You can treat it as a ResourceBundle:

String bundleName =
"com.mycompany.myapp.ApplicationResources";

ResourceBundle  bundle
   ResourceBundle.getBundle(bundleName,
currentLocale);

Leave out currentLocale if you want the default.

A more consistent way is, if you have access to the
Session"

MessageResources bundle = (MessageResources)
request.getSession().getServletContext().getAttribute
("org.apache.struts.action.MESSAGE");


-Kevin

--- Zoran Avtarovski <[EMAIL PROTECTED]> wrote:
> I have what is hopefully a simple question.
>
> I have a set a number of file system specific
> variables in my
> ApplicationResources.properties file to make it
> easier to deploy the
> application on different platforms.
>
> I can access Message Resources properties from
> Action classes using:
>
>     MessageResources messages =
> getResources(request);
>     String message =
> messages.getMessage("the.chosen.message");
>
> Outside an action class I'm having trouble
> instantiating the
> MessageResources.
>
> I can see that I need to use:
>
>     MessageResources messages = MessageResources (x,
> y);
>
> But I don't know what arguments  to pass as x and y
>
> Could somebody please email me a way to get this
> done in my helper classes.
>
> Thanks
>
> Zoran
>
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> [EMAIL PROTECTED]
> For additional commands, e-mail:
> [EMAIL PROTECTED]
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]









This transmission may contain information that is privileged, confidential and/or 
exempt from disclosure under applicable law. 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to