• Post Reply Bookmark Topic Watch Topic
  • New Topic

ServletRequest.  RSS feed

 
Marcos Dytz
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm making an application that has this Listbox in a HTML Form and I'm building the servlet right now to get all the content of this Listbox and making it a array of Strings. I know that the getParameter() will return a String, although I dont have a clue on how this String would like if it's coming from a Listbox. Anyone has any idea?
My other doubt is if the getParameterValues() would work in such a situation?
My last doubt, how could I print the content of this String in a .jsp using the forward()? Would a out.print work?
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you have to take care of the possibility of multiple items selected in a list box then you certainly want to use getParameterValues. It returns either an array of String (from size 1 to ??) or null. Obviously, to print values from a String[] you need a loop.
Bill
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!