This week's book giveaway is in the Jython/Python forum.
We're giving away four copies of Murach's Python Programming and have Michael Urban and Joel Murach on-line!
See this thread for details.
Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Need to dynamically populate an array  RSS feed

 
Matt Peterson
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I want to do is to dynamically populate an array in jsp by calling a unix script that returns the array elements. I don't need to know how to write the script or the array. I just need to know how to execute the script from jsp and to populate the array.

This is really a repeat of the same post I made earlier that was moved to linux/unix. But it is not the unix portion that I am confused about.
Thanks,
-Matt.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will have to execute the Unix script using one of the many Java Runtime exec() method variants, and parse the output stream from the script to fill your array.
Hint: get this debugged by using a stand alone Java application, MUCH simpler than starting with a JSP. My servlets book has an example calling a Perl script.
Bill
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!