Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

problem with select option to be used in JSP

 
Chintan Shah
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hey guys,
I am doing this thing. please forgive me..as i could not post new topic using <>..so i am just writing simple html code without <>..hope u guys understand
select name="time" multiple
option value="17" 5:00 PM option
option value="19" 7:00 PM option
option value="21" 9:00 PM option
option value="23" 11:00 PM option
select
When i try to retrieve "time" with multiple selection as 5:00 Pm,7:00 Pm ..on another page with request.getParameter("time")..it shows only the first selected value...
how do i get all values?
any help appreciated.
Chintan
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Before posting on a forum, it's a good idea to check the API documentation. Read what it says about getParameter().
 
vasuma patel
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using getParameterValues("time")
 
Chintan Shah
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I tried using getParameterValues...but problem is it is not showing proper values.
When i try to show time values on next page it shows
[Ljava.lang.String;@7aa187
i dont know what is this.
chintan
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65115
89
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Chintan Shah:
I tried using getParameterValues...but problem is it is not showing proper values.


Do you not think that would have been useful information to put into your first post?


When i try to show time values on next page it shows
[Ljava.lang.String;@7aa187
i dont know what is this.


That is what happens when you try to display an array. You'll need to iterate over the individual values if you'd like them to display individually.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic