[ 
https://issues.apache.org/jira/browse/WW-3365?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Lukasz Lenart closed WW-3365.
-----------------------------
    Resolution: Not A Problem

> There will be no log4j error message while it displays warning "The visited 
> object is null, VisitorValidator will not be able to handle validation 
> properly. Please make sure the visited object is not null for 
> VisitorValidator to function properly"
> -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: WW-3365
>                 URL: https://issues.apache.org/jira/browse/WW-3365
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core Interceptors
>    Affects Versions: 2.1.2
>         Environment: Tomcat 6.0 + Struts 2.1.2
>            Reporter: jession ji
>            Priority: Major
>             Fix For: 6.1.0
>
>
> We use log4j debug in all validator methods to get the detail for illegal 
> input. And we found that there will might be no log4j log and a waring on 
> tomcat server "The visited object is null, VisitorValidator will not be able 
> to handle validation properly. Please make sure the visited object is not 
> null for VisitorValidator to function properly". It will be OK after we 
> restart tomcat server. This issue can not be found every time. Could anyone 
> give me some advice?
> public void validate(Object object) throws ValidationException {
>         String fieldName = getFieldName();
>         String val = (String) getFieldValue(fieldName, object);
>         log.logInfo("Field:" + fieldName + " &Value:" + val);
>         if ((minLength > -1) && (val.length() < minLength)) {
>             addFieldError(fieldName, object);
>         } else if ((maxLength > -1) && (val.length() > maxLength)) {
>               log.logError("Input validation max length checking 
> failure:"+fieldName);
>             addFieldError(fieldName, object);
>         }



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to