I think what you want is to leave out the "required" validator, but to
use the "minlength" validator with a value of 1. That should allow a
blank, but not a String shorter than 1, and whitespace should be left
out in the measurement. (I'm not positive as I don't have the source).
Erik
Frank Burns wrote:
But I want to be able to accept an "empty" value and just reject
whitespace. That is, I don't want whitespace to be accepted as a vaid
value -- it should be either empty or contain a valid
(non-all-whitespace) value.
----- Original Message ----- From: "Joe Germuska" <[EMAIL PROTECTED]>
To: "Frank Burns" <[EMAIL PROTECTED]>; "Struts Users
Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, November 21, 2004 2:20 PM
Subject: Re: Want to reject all-whitespace text input.
The "required" validator should do what you need. It requires that
the value be non-null and have at length > 0 after String.trim() is
called.
Joe
At 1:22 PM +0000 11/21/04, Frank Burns wrote:
Hi,
I am trying to write a regular expression for a mask, for use in the
validation.xml file, that will reject input text that consists of
all whitespace characters. But, no matter what pattern I try, an
all-whitespace entry is always accepted.
Is there some strange rule, as part of the Validator's validation
process, that always accepts whitespace? Or is there something else
going on?
Do I have to resort to accepting the all-whitespace input, detecting
it in the ActionForm's validate method and manually setting a
message in ActionErrors?
Thanks,
Frank.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
--
Joe Germuska [EMAIL PROTECTED] http://blog.germuska.com
"Narrow minds are weapons made for mass destruction" -The Ex
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]