I want to display a javascript alert. But i want to use a resource bundle where i've stored key/values of different alert strings. Is it possible that i can pick up those values by using s:text tag in my JAVASCRIPT file?
Only if your JavaScript file is processed through the normal JSP flow. Why not pass in the message to the JavaScript?
aman thind
Ranch Hand
Joined: Jun 29, 2007
Posts: 71
posted
0
David Newton wrote: Why not pass in the message to the JavaScript?
I am not sure what you are asking:( Are you asking why i am not displaying it directly in the Javascript? I want to display alert messages depending upon user locale. That's why i need my js file to pick up different resource bundles depending upon the locale to display alerts in different languages.
No, I'm saying "pass in the resource to the JavaScript function (that does the alert)". Your other option is to process your JavaScript files through the JSP processor. Or build localized JS files during the build process. Or create a global message map during build. Or... you get the idea.