Hi,

I'm trying to use annotations to validate some fields in my application. The
code is this:

@Validation
public class Teste extends ActionSupport {

    private Cliente cliente;

    @VisitorFieldValidator(message = "")
    public Cliente getCliente() {
        return cliente;
    }

    public void setCliente(Cliente cliente) {
        this.cliente = cliente;
    }

    @Override
    @SkipValidation
    public String execute() throws Exception {
        // TODO Auto-generated method stub
        return super.execute();
    }
}

@Validation
@Entity
@Table(name="cliente")
@SequenceGenerator(name = "sqc_cliente", sequenceName = "sqc_cliente")
public class Cliente {

...

    @EmailValidator(message = "dfdfdf")
    public String getBairro() {
        return bairro;
    }

...

}

<s:form action="teste.do" method="POST">
    <s:textfield name="cliente.email" label="E-mail" />
    <s:submit value="Enviar" />
</s:form>

These is my configurations do validate data using annotations support.
Something is wrong because the form is not validated.

Someone can help me to solve this problem ?

Thanks.

-- 
Att
Guilherme Mello do Nascimento [http://guilhermemello.com]
PortalJava.com - A maior comunidade Java do Brasil

Reply via email to