struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neil Aggarwal" <>
Subject RE: Struts2 Multiple validation for single field
Date Mon, 16 Nov 2009 15:24:00 GMT

> If I am declaring it as int how should I check for null.

OK, I think I see what you are asking.

If you change your field to an int field and the
user  does not fill in the value, you will
get zero.  If they put in zero, you will get zero
and there is no way to tell the difference.

Is that the problem?

I think you are going to have to do it manually.

Set your field as a String and then in your
validate method, check if it is null or a valid
int value.  If it is not what you want, throw
an ActionError.


Neil Aggarwal, (281)846-8957,
Host your struts app on a CentOS VPS for only $25/month!
Unmetered bandwidth, 7 day no risk trial, Google Checkout

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

View raw message