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 radio button in struts 2 Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Frameworks » Struts
Reply Bookmark "radio button in struts 2" Watch "radio button in struts 2" New topic
Author

radio button in struts 2

rahulJ james
Ranch Hand

Joined: Oct 03, 2008
Posts: 123
How to define a radio button in a jsp and get the correspodning values in the action.. I will have 10 fields each with 2 radio buttons

Advise please
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 676

hi,

Using Struts 2.0 Radio button is not simple to use.
But if you want to use it use like ....

<tr>
<td><s:radio list="#{templateId:name}" name="shopSettings.template.templateId" theme="simple" value="checkedInt" />
</td>
</tr>

where templateId is use for radio button value and name used for display on Jsp radio button name.

you can take value in Action class simple using templateId getter and setter method.

But i would recommend to use simple HTML radio for your Jsp.



Thanks,
Nishan Patel.


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: radio button in struts 2
 
Similar Threads
Check boxes
Redrawing the UI
radio button
get value from radio button
radio button