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]