Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

populating javascript arrays from struts

 
BC claudio
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i need to populate arrays in javascript for use in client side interactivity.
ive seen the org.apache.struts.taglib.html.JavascriptValidatorTag but i dont know if its useful..

does anyone have an idea?
 
alan do
Ranch Hand
Posts: 354
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
if you have your array values are coming from your action (as a collection, arraylist, map, etc.), iterate through the them using logic:iterate or c:forEach INSIDE the <script...> tag to construct the js arrays then proceed with the js business as usual.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The org.apache.struts.taglib.html.JavascriptValidatorTag would not be useful here. It's purpose is to render javascript created by the validator.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic