• 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

how to access resource bundle in included JS file

 
Ranch Hand
Posts: 31
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,

we are using JSF1.1, JSTL, SUN-Ri, webui.

In our JSP page we include the resource bundle like bellow

<f:loadBundle basename="com.bundle.messages" var="bundle"/>

We are able to access resource bundle key/value in jsp or js code (under <script></script> tag) like bellow
${bundle.user_name_label}

But now we have a requirement in which we have to access bundle key/value in INCLUDED js file.
we are including js file like bellow
<webuijsf:script url="resources/reports.js" />

Actually we are trying to implement I18N in our application. And we are trying to fetch the Error messages also from resource bundle. Some of the javascript code is written in jsp page under script tag we dont have any issue to fetch the key/value from resource bundle.
But we have some external js file which we include in our jsp page, in that also there are some Error messages, we also want to access that from resource bundle.
So how can we access bundle from external JS file?

Thanks in advance
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Roby, the same answer gived by Tim on this post is valid to this one. In resume, JS files runs on client side.
 
I need a new interior decorator. This tiny ad just painted every room in my house purple.
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic