• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Is it possible to display javascript alerts with s:text tag by picking values from a resource bundle

 
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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?
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 71
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic