[Logo] RSF Discussions Forum
  [Search] Search   [Recent Topics] Recent Topics   [Members]  Member Listing   [Groups] Back to home page 
[Register] Register / 
[Login] Login 
BeanGuard + BeanLocator + Spring Validator + warning in log  XML
Forum Index -> RSF Help and Problems
Author Message
Wilhelm
Request-scope Wrangler

Joined: 06/02/2008 08:55:43
Messages: 20
Offline

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
antranig
Request-scope Wrangler

Joined: 03/04/2006 13:29:55
Messages: 643
Offline

Hi there - thanks for this report, Wilhelm. It looks like this is a bug which I have JIRAed for the next release - https://bugs.caret.cam.ac.uk/browse/RSF-133 . It should be the job of the framework to ensure that wildcard paths are properly concretised during the invocation phase. I can't really suggest much you can do to alleviate this problem until the next release other than what you have done - apologies, A.
 
Forum Index -> RSF Help and Problems
Message Quick Reply
Go to:   
Powered by JForum 2.1.6 © JForum Team