commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sebb (JIRA)" <>
Subject [jira] [Resolved] (VALIDATOR-260) ValidatorAction should handle missing jsFunction nicer
Date Sun, 05 Feb 2017 18:58:41 GMT


Sebb resolved VALIDATOR-260.
    Resolution: Won't Fix

Javascript validation is no longer supported.

> ValidatorAction should handle missing jsFunction nicer
> ------------------------------------------------------
>                 Key: VALIDATOR-260
>                 URL:
>             Project: Commons Validator
>          Issue Type: Improvement
>          Components: Framework
>    Affects Versions: 1.3.1 Release
>         Environment: java 1.4.2_17
>            Reporter: Vasily Ivanov
>         Attachments: VALIDATOR-260.patch
> Example of custom validator:
>     <validator name="dateRange"
>       classname="SomeClass"
>       method="validateDateRange"
>       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"
>       depends="date" msg="errors.daterange"
>       jsFunction="" />
> When jsFunction resource is missing (due to classpath or packaging issue, for example)
ValidatorAction.readJavascriptFile(String) method just logs message "Unable to read javascript
name com/company/path/to/jsfile/validateDateRange.js" on DEBUG(!) level, silently ignores
it and process with other validators. Than all web pages are completely screwed up with errors
complaining about missing javascript function but no reason why. It took me few hours to figure
out what the problem is.
> Validator should at least log that message on warn/error level. I think it's even better
to throw some kind of initializing exception. If jsFunction is specified you expect Validator
to load it or fail if it can't find it not silently ignore it.

This message was sent by Atlassian JIRA

View raw message