aspose file tools*
The moose likes Struts and the fly likes Radio Button Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Radio Button" Watch "Radio Button" New topic
Author

Radio Button

cathymala louis
Ranch Hand

Joined: Nov 02, 2005
Posts: 77
Hi All,

If I have a two radio buttons.

<html:radio value="Red" property="Color" >Red</html:radio>
<html:radio value="Blue" property="Color" >Blue</html:radio>

How will I get the value which I clicked in Action form. I want to print out the value which I selected in console.

While I try to run the program. I am getting the following error message. Even though my action form has a getter and setter method.

[8/16/07 10:26:31:758 CDT] 56c1b1a9 WebGroup E SRVE0026E: [Servlet Error]-[No getter method available for property Color for bean under name org.apache.struts.taglib.html.BEAN]: javax.servlet.jsp.JspException: No getter method available for property Color for bean under name org.apache.struts.taglib.html.BEAN
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
Originally posted by cathymala louis:
How will I get the value which I clicked in Action form. I want to print out the value which I selected in console.

Just reference the property on the ActionForm bean. Example:

In the above code, the variable form represents the instance of ActionForm that is passed into the execute method as a parameter.
Originally posted by cathymala louis:

While I try to run the program. I am getting the following error message. Even though my action form has a getter and setter method.

You're getting this error message because the property in the JSP should be color, not Color.
[ August 16, 2007: Message edited by: Merrill Higginson ]

Merrill
Consultant, Sima Solutions
cathymala louis
Ranch Hand

Joined: Nov 02, 2005
Posts: 77
Thanks a lot. As you told I changed Color to color it worked. Thank you again.
 
 
subject: Radio Button