Hi all. I've been having a problem with resource bundles. My action extends
ActionSupport, and in my velocity templates I've been making calls to
$action.getText(), which is my first question: is that the best way to call
getText()? I read something in the archives about using
$text('resource.name'), but that hasn't worked for me. I'm storing the
locale in the session, and I overrode ActionSupport.getLocale() to get the
session value. The LocalizedTextUtil.findText method makes a call to
ActionContext.getContext().getLocale(), which was always returning US-en,
even though I've got a German system, so I know my getLocale() method wasn't
being called. To solve this all, I overrode the getText method altogether
with
public String getText(String aTextName) {
        return LocalizedTextUtil.findText(this.getClass(), aTextName, getLocale());
}
which works, but smells. Any suggestion on how to do this cleaner, without
having to overwrite getText?

-Robert



-------------------------------------------------------
This SF.net email is sponsored by: The SF.net Donation Program.
Do you like what SourceForge.net is doing for the Open
Source Community?  Make a contribution, and help us add new
features and functionality. Click here: http://sourceforge.net/donate/
_______________________________________________
Opensymphony-webwork mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/opensymphony-webwork

Reply via email to