Im trying to understand what happens in the following case..
If I have a simple command object like the following..
My jsp page has the following form
private int mMyCommandValue;
public int getMyCommandValue()
public void setMyCommandValue(int value)
mMyCommandValue = value;
And heres my validators validate method...
<input type="submit" value="submit/>
Now in the examples It shows that you can further validate the command object by doing such things as
public void validate(Object object, Errors errors)
MyCommand myCommand = (MyCommand) object;
ValidationUtils.rejectIfEmptyOrWhitespace(errors, "myCommandValue", "error.required", "Required Field");
But what if i want to ensure that the user hasnt entered a character into the form field? Does the BeanWrapper set the commands value to null, or does it leave it as it is?
if (myCommand.getMyCommandValue() < 10)
errors.rejectValue("myCommandValue", "error.too_low", "Value too low");
How do i tell the user that they entered a non numeric value into the form?