struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Knorr" <>
Subject Long property defaulting to zero
Date Wed, 17 Jul 2002 20:34:25 GMT

We just upgraded from struts 1.0 to struts1.1beta and are encountering an issue with some
properties on our forms. If the value being set and returned is a wrapper type like Long,
struts is setting the default value to zero instead of null... for example:

public Long getAccountNumber() {
	return accountNumber;

public void setAccountNumber(Long accountNumber) {
	this.accountNumber = accountNumber;

If on our form we have a hidden field <html:hidden property="accountNumber"/> and when
load the form the value for this "empty", but when we submit the form, struts sets the value
to zero.  Is this correct or should it be null?  Regardless, does anyone know how to configure
struts so that the default value is null rather than zero?

Thanks in advance,


To unsubscribe, e-mail:   <>
For additional commands, e-mail: <>

View raw message