This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes populating javascript arrays from struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "populating javascript arrays from struts" Watch "populating javascript arrays from struts" New topic
Author

populating javascript arrays from struts

BC claudio
Greenhorn

Joined: May 02, 2005
Posts: 5
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

Joined: Apr 14, 2005
Posts: 354
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.


-/a<br />certified slacker...yes, my last name is 'do' - <a href="http://www.luckycouple.com" target="_blank" rel="nofollow">luckycouple.com</a>
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
The org.apache.struts.taglib.html.JavascriptValidatorTag would not be useful here. It's purpose is to render javascript created by the validator.


Merrill
Consultant, Sima Solutions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: populating javascript arrays from struts
 
Similar Threads
Popluateing a 2d array
creating table on client side
Shoud I use window.location.replace() with Struts?
JavaScript?????
problem with javascript array and undefined values in Internet explorer