Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Pass value of a combobox to ... ?

 
marko markovic
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
on a JsPage with scope="session", i have a combobox and want to pass his values and his selected value to another JsPage with Session or something other.
What is the best method to pass the values and not forget the selected value and get the same like:
First page: example of a combobox
combobox:
Key: 1 One
2 Two <= selected value
3 Three
now pass to the second page:
combobox:
Key: 1 One
2 Two <= selected value
3 Three
Thanks for help!
$Regards
 
Kevin Mukhar
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The combobox is in a <form> tag. Simply submit the form to another JSP. In the other JSP you can get the selected values by calling
String name = "name_of_combo_box";
String[] selections = request.getParameterValues(name);
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!