my dog learned polymorphism*
The moose likes Java in General and the fly likes input type= Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "input type="checkbox" boolean value" Watch "input type="checkbox" boolean value" New topic
Author

input type="checkbox" boolean value

Vinnie Jenks
Ranch Hand

Joined: Apr 26, 2004
Posts: 207
Hi all,

I've got a form where I'm trying to load the parameterMap into a business object automatically using the BeanUtils class.

I can get everything to work but two form fields which are checkboxes w/ a value="true". It should load two setters in my class called "setIsAtLunch(boolean arg)" and "setIsInOffice(boolean arg)"...but it skips these two, presumably because they are booleans and somehow it isn't translating in the BeanUtils.populate() method.

I've named the form fields "isAtLunch" and "isInOffice" respectively so according to the JavaBeans spec, it should capture them just fine.

If I pull them out and wrap them w/ Boolean.parseBoolean() they work just fine...but I *really* would rather use BeanUtils - and I wouldn't imagine that it couldn't handle any form field type.

Any ideas?

Thanks!
 
Consider Paul's rocket mass heater.
 
subject: input type="checkbox" boolean value
 
Similar Threads
maven/ant/ldap problems
Struts2 ajax theme - One form, two buttons.. two actions?
<Generics> Is this a good use of Java Generics?! UPDATED: Another question included.
is there any algorithm to update bean propeties from a properties file?
Tricky NullPointerException Problem