Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

html:Checkbox

 
Ashish Bassi
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have an a Form

class myForm extends ActionForm {
SportsBean sportBean;
//sportsBean getters n setters
}

class SportsBean {
private cricket;
private hockey;
//getters and setters
}

Now in my Jsp, i want to associate 2 checkboxes with these porperties in sportsbean

im doign somethign like this in my jsp

<html:checkbox property="sportsBean.cricket">
</html:checkbox>

but i get an error
javax.servlet.ServletException: Invalid argument looking up property: "sportsBean.cricket" of bean: "org.apache.struts.taglib.html.BEAN"
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Make sure you instantiate the bean when it is defined. Example:
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!