Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Retrieve values from JSP" Watch "Retrieve values from JSP" New topic
Author

Retrieve values from JSP

Hans Thiel
Greenhorn

Joined: Nov 26, 2007
Posts: 1
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

Joined: Jul 11, 2001
Posts: 15299
    
    6

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: http://aspose.com/file-tools
 
subject: Retrieve values from JSP
 
Similar Threads
printing index of an collection in JSP using JSTL
Radio Select and Other
how to do Multiple checkbox binding in spring
control the width of the fieldset
Struts2: I want to use <s:textfield> inside <s:checkbox>, is it possible?