You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Bryan Field-Elliot <br...@netmeme.org> on 2001/03/02 19:08:35 UTC

ActionForm questions

New to Struts here --

Question about creating ActionForm beans --

What kinds of data types are supported? I could not find a reference to 
this in the docs. For example, I want to have an input box on my forms, 
where the user can enter a number. Or, they can leave it blank. I want 
"blank" to show up as null, not zero. Should I implement my ActionForm 
bean as follows?

Integer qty;

Integer getQty() { return qty; }
void setQty(Integer) { this.qty = qty; }

I've chosen Integer because it can hold a value, OR it can be null 
(which is the behavior I'm looking for).

Will this work, or must I restrict my data types to Strings and do 
conversion somewhere else?

Thanks,
Bryan