On 2/22/07, Steve Vanspall <[EMAIL PROTECTED]> wrote:
Hi,

I am sorry for the really obvious question, I have searched google etc,
can't find the answer.

Basically I am involved with the upgrade of struts from a very old
version to the latest one, this incorporates an upgrade to
commons-validator.

I have never used commons-validator before but the existing code base I
am working on is fairly dependant on it.

I have worked out some of the changes from the version we were using (1.0.2)

My problem now is that the pages that use javascript validation
currently include the required javascript for the validation functions,
but does not include the validator utils javascript functions.

Is there some addition I have to make with to validator-rules.xml or
validation.xml to have validator util included. I assume I don't have to
actually include the validator js file in the page as it seems the
validator-rules is set up to inlcude only the required javascript for me.

Yes there is (its a <validator name="includeJavaScriptUtilities"> entry)
- but really you should upgrade to the validator-rules.xml file that
is shipped with the version of Struts you're upgrading to - which has
this in and other changes that  might cause you problems if you use an
old version.

Niall


basically the javascript validation doesn't work because the browser
doesn't have the code for jcv_retrieveFormName function.

I have included below a sample of the converted validation-rules, I
didn't include it all because it still have some changes to make to
comply with he new version.

----------
 <validator name="required"
            classname="org.apache.struts.validator.FieldChecks"
               method="validateRequired"
         methodParams="java.lang.Object,
                       org.apache.commons.validator.ValidatorAction,
                       org.apache.commons.validator.Field,
                       org.apache.struts.action.ActionMessages,
                       org.apache.commons.validator.Validator,
                       javax.servlet.http.HttpServletRequest"
                 jsFunction="required">
----------

this originally had the javascript defined in the xml file, changing it
to what you see above has now created the correct javascript for this
version.

Any help would be great

Regards

Steve

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

Reply via email to