File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
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]

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: RadioButtons in Different Rows Struts 2
 
Similar Threads
Putting it together: Struts, Tags, OGNL
To many Frames
Frame Attack!
validation in radio buttons
Validation skip