Hello,

I'm using the i18n support in Struts in my applications, and am trying to
localize my client-side Javascript validation messages using
<bean:message/>.  I've tried

   var msg='<bean:message key="login.error.username"/>';
   alert(msg);

and

   alert(<bean:message key="login.error.username"/>);

and many other combinations, none of which worked for me.  Has anyone been
able to use <bean:message/> with Javascript?


I searched the archives and found a message from Pierre Metras dated
10-Nov-2000 where he mentions creating a utility class to retrieve localized
messages.  I'm about to try to create such a class, but how would the
utility class access the Struts Locale setting in the session, and retrieve
the name of the properties file to use?  Its not a tag so the pageContext is
not supplied.

Thanks,

Denis Hanson



Reply via email to