Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

bean taglib inside javascript

 
sudin prans
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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

alert(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
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Also, don't forget to close the bean:message tag!
 
sudin prans
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry ..its not working still..its still the same.I think I wont get the client side javascript value in the jsp attribute.
Thanks.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic