Hello
I am using BeanGuards with a Spring Validator.
In my applicationContext:
Code:
<bean id="myMessageGuard" parent="writeGuardParent">
<property name="guardedPath" value="MyBeanLocator.*"/>
<property name="guard"> <bean class="path.to.MyValidator" /></property>
</bean>
MyBeanLocator is a BeanLocator for the bean I am validating. In this case the specific bean will be something like MyBeanLocator.new 1
In the validate method of my validator ("fieldName" is a field on the bean I am validating)
Code:
public void validate(Object obj, Errors err) {
ValidationUtils.rejectIfEmptyOrWhitespace(err, "fieldName",
"errors.fieldName.empty");
}
Everything works as I think it should (validate() called, errors written to targettedMessageList and displayed) but I keep getting the following warning in the log:
WARN [btpool0-0] (TMLFixer.java:47) - Message queued for non-component path MyBeanLocator.*.fieldName
Has this something to do with guarding a bean locator? If I just use the following (not using ValidationUtils and specifying a field) in the validate method I don't get a warning:
Code:
// Using own code to check if fieldName empty instead of ValidationUtils
err.reject("errors.fieldName.empty");
What is the best way to use beanGuards using BeanLocators? Is there something specific I can do to fix it that the warning is not displayed?
Regards
Wilhelm