Hi,

I assume that you would just validate on the nested form property named
"contactValue.email".

Cheers,
-Steve

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, November 20, 2003 4:38 AM
To: [EMAIL PROTECTED]
Subject: Validator Framework & Value Object ActionForm


Hi all,

I have the following action form:

/*
 * Created on Nov 19, 2003
 *
 * To change the template for this generated file go to
 * Window - Preferences - Java - Code Generation - Code and Comments
 */
package nl.informatiefabriek.addressbook.form;

import nl.informatiefabriek.addressbook.value.ContactValue;

import org.apache.struts.action.ActionForm;

/**
 * @author harm
 *
 * @struts.form name = "contactForm"
 */
public class ContactForm extends ActionForm {
        private ContactValue contactValue = new ContactValue();

        /**
         * @return Returns the contactValue.
         */
        public ContactValue getContactValue() {
                return contactValue;
        }

        /**
         * @param contactValue The contactValue to set.
         */
        public void setContactValue(ContactValue contactValue) {
                this.contactValue = contactValue;
        }

}

As you can see my Action Form only stores a ValueObject (Data Transfer
Object) which is send to the EJB tier in my application.
My ValueObject contains a property 'email'.:

<snippet>
 public java.lang.String getEmail()
   {
          return this.email;
   }

   public void setEmail( java.lang.String email )
   {
          this.email = email;
          emailHasBeenSet = true;

   }
</snippet>

I would like to use the Validator Framework to validate the emailaddress
stored in the ValueObject.

I'm not sure on how to do this, because the email property is stored in
the Value Object and not in the ActionForm object.

Can somebody provide me a hint on how to validate this using the Validator
Framework?

Thanks,

Harm de Laat
Informatiefabriek
The Netherlands


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to