File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Retrieve values from JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Retrieve values from JSP" Watch "Retrieve values from JSP" New topic

Retrieve values from JSP

Hans Thiel

Joined: Nov 26, 2007
Posts: 1

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?

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15302

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.

GenRocket - Experts at Building Test Data
I agree. Here's the link:
subject: Retrieve values from JSP
It's not a secret anymore!