Commits

mrdon  committed 1822bd5

Fix field naming for nested beans in a collection

git-svn-id: http://svn.opensymphony.com/svn/xwork/trunk@1614e221344d-f017-0410-9bd5-d282ab1896d7

  • Participants
  • Parent commits 8c287b3

Comments (0)

Files changed (1)

File src/java/com/opensymphony/xwork2/validator/validators/VisitorFieldValidator.java

         Object o;
         String field;
         String message;
+        private ValidatorContext parent;
 
         public AppendingValidatorContext(ValidatorContext parent, Object object, String field, String message) {
             super(parent, makeTextProvider(object, parent), parent);
             //            super(parent);
             this.field = field;
             this.message = message;
+            this.parent = parent;
         }
 
         /**
          * @return field name in OGNL syntax
          */
         public String getFullFieldName(String fieldName) {
+            if (parent instanceof AppendingValidatorContext) {
+                return parent.getFullFieldName("") + field + "." + fieldName;
+            }
             return field + "." + fieldName;
         }