wood burning stoves 2.0*
The moose likes Struts and the fly likes bean  taglib  inside javascript Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "bean  taglib  inside javascript" Watch "bean  taglib  inside javascript" New topic

bean taglib inside javascript

sudin prans

Joined: Sep 02, 2005
Posts: 4

var labelTxt = "changingValues"
labelTxt = '<bean:message key="labelTxt">'


My javscript function has the above statements.
the variable labelTxt can have different values,these will be the keys in the property file,so depending on the variable the correct keyvalue should be fetched.
But if I give as above ,it is searching for the key labelTxt in my property file.
Pls help.
Thnks in advance.
Choon-Chern Lim
Ranch Hand

Joined: Aug 29, 2005
Posts: 74
Sure... but make sure your javascript is sitting in jsp file instead of a js file.

Try this in your jsp:-
Marc Peabody
pie sneak

Joined: Feb 05, 2003
Posts: 4727

Also, don't forget to close the bean:message tag!

A good workman is known by his tools.
sudin prans

Joined: Sep 02, 2005
Posts: 4
Sorry ..its not working still..its still the same.I think I wont get the client side javascript value in the jsp attribute.
subject: bean taglib inside javascript
Similar Threads
Best way to place property file values in Webspehere
Property strings in Icefaces
bean:message in bean:define tag
create property fiel with Map
Identifying some special characters in a string