This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Struts and the fly likes RadioButtons in Different Rows Struts 2 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 » Frameworks » Struts
Bookmark "RadioButtons in Different Rows Struts 2" Watch "RadioButtons in Different Rows Struts 2" New topic
Author

RadioButtons in Different Rows Struts 2

Sanket L Shah
Ranch Hand

Joined: May 08, 2009
Posts: 49

Hi All,
I am developing one Quiz application using Struts 2 and hibernate, I am facing some problem with radio button. Please help me out!!!

My Classes are


I am having Question's object on my JSP.
Exa.
Question :
id : 1
question : Is Java an Object Oriented Language?
List<Answer> : {Answer 1, Answer 2}

Answer 1:
id : 1
answer : Yes

Answer 2:
id : 2
answer : No


When I write code like

then it displays all the radio button in one row and also do not displays the answerStr from the class Answer. Instead of answerStr it displays string written by toString() method.

When I write

Then it displays Radio button with proper label which is Yes. but what about the other values in answersList?


I want like
1. Is Java an Object Oriented Language?
(Radio1) Yes
(Radio2) No

but it gives me like
2. Is Java an Object Oriented Language?
(Radio1) com.quize.beans.domain.Answer@177060f (Radio2) com.quize.beans.domain.Answer@1DR0D0f


PLEASE HELP ME OUT







[Thumbnail for JavaRanchImage.JPG]

 
 
subject: RadioButtons in Different Rows Struts 2
 
Similar Threads
Frame Attack!
Validation skip
validation in radio buttons
Putting it together: Struts, Tags, OGNL
To many Frames