This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes extends StrutsTypeConverter for java.lang.Boolean Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "extends StrutsTypeConverter for java.lang.Boolean" Watch "extends StrutsTypeConverter for java.lang.Boolean" New topic
Author

extends StrutsTypeConverter for java.lang.Boolean

Keeno Banks
Greenhorn

Joined: Sep 30, 2013
Posts: 1
I'm looking for a Type Converter that extends StrutsTypeConverter for Boolean.

In convertFromString(Map context, String[] values, Class toClass)
I'd like it to return null when the value is "-1" and Boolean.TRUE and Boolean.FALSE

In convertToString(Map arg0, Object arg1)
I'd like it to return "-1" for null, "true", and "false"

I'd like this converter to work for a collection of Booleans as well. For example I may have 5 <select name='color'></select>. All 5 dropdowns have the same name.

If someone could help, I would appreciate it.

Thanks,
kcentral
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: extends StrutsTypeConverter for java.lang.Boolean
 
Similar Threads
How to get subclass objects in an arraylist?
TypeConversion with Struts 2
ModelDriven/Hibernate validation issue
Data conversion in Hibernate
date conversion problem