Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

printing the values of an array

 
Savanna Ray
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

I have almost finished making this code work. It's supposed to print out the name/value pairs of a query string (eg.from a form URL query string).
I've got it to print out the 'name' part of the pair array, but can't seem to print out the 'value' part.

Here's the code:



I changed the print method, in util class, to take a String name as well, but it didn't compile. Any suggestions on how to print the last half of the array?

Thanks so much...
Almost finished
 
Savanna Ray
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I thought it would be able to access the form class from the print method, but compiling says it can't find symbol variable form.
Maybe I should be invoking the method getValue differently?
 
Rick Portugal
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not completely sure what you're trying to accomlish. It seems that this code could be simplified. But take a look at this and let me know if this helps:

I made the getValues() method just like the getNames() method. I also changed the Util.print() method to accept two arrays of Strings. I'm puzzled as to why the Util.print method uses arrays called array and name. I would have expected something like "name" and "value".

Hope that helps.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic