• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Radio Button

 
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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 ]
 
cathymala louis
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks a lot. As you told I changed Color to color it worked. Thank you again.
 
The fastest and most reliable components of any system are those that are not there. Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic