I don't think it is the formbean that is checked for isString() it is the
data members of the formbean.  Since it is http I guess there is only 2
choices: String and String[] and so the test determines how the validation
for a value is to be done. 

Kinda goes back to that old question posted here...

It would be the difference between testing .length and .length() !!

:-)


-----Original Message-----
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 6:30 PM
To: 'Struts Users Mailing List'
Subject: RE: Validator

I guess it's more efficient if bean is a String type.  (Damn, I just cannot
see
when you would have a FormBean of type String only).

Anyway, I don't think it's needed...  This is going to bug me for the whole
evening:).

-----Original Message-----
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: August 6, 2003 5:13 PM
To: 'Struts Users Mailing List'
Subject: RE: Validator


It's in the code of FieldsCheck.java. I was trying to create one of my
own validator and I saw these lines  there.

Erez

-----Original Message-----
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 12:10 AM
To: 'Struts Users Mailing List'
Subject: RE: Validator

???

I don't see it in my validation-rules.xml.  Which version are you using?

-----Original Message-----
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: August 6, 2003 3:33 PM
To: 'Struts Users Mailing List'
Subject: Validator



I am trying to figure out the code in struts.validator.FieldsCheck.java
in order to write one of my own.
Can someone explain what the purpose of the following lines of code in
all of the validateXXX() in Struts:

        validateIntRange (...) {

                if (isString(bean)) {
                        value = (String) bean;
                }
        ...
        }

        Is this really necessary?

Erez



---------------------------------------------------------------------
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]




---------------------------------------------------------------------
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]

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

Reply via email to