This week's book giveaway is in the Java in General forum.
We're giving away four copies of Think Java: How to Think Like a Computer Scientist and have Allen B. Downey & Chris Mayfield on-line!
See this thread for details.
Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Retrieve values from JSP

 
Hans Thiel
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello!

I have the following forEach loop in my JSP:


Because the names of the checkbox and radios are generated dynamically (loopStatus), the operations:

simply won't go. How can I retrieve values from selected checkbox and radio buttons with loopStatus in my form controller (onSubmit) using the request object? Any ideas?

Cheers
Hans
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want all your radio buttons to be part of the same group their names must all be the same. So you shouldn't be indexing them like you are. I'm not sure why you think you need to do that but just remove the [] indexes from the names.

Also, I am moving this to the JSP forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic