I'm not sure were is the problem but I've just checked such simple
example below and everything is ok. Maybe you should consider to use
Long instead of Integer, because when you enter more then 2147483647
to the field you will get some strange value back to the input
(because you loose precision ;-)

class EmployeeAction extends ActionSupport {

private Integer cardNo; // getter & setter

 public void validate() {
        if (cardNo == null) {
            addFieldError("cardNo", "Should be integer!");
        } else if ( cardNo < 1 || cardNo > 999999) {
            addFieldError("cardNo", "Should be integer!");
        }
}

}

JSP

<s:textfield label="Card Number" name="cardNo" />


Regards
-- 
Lukasz

http://www.linkedin.com/in/lukaszlenart

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to