Frage

I want to use annotation to validate my action.

but the data is located in a model (because the modeldriven interface), So I cannot annotation the action fields.

So, How can I annotation the "Model"'s fields?

War es hilfreich?

Lösung

You can use annotations by using @VisitorFieldValidator on your overridden getModel() method.

@Override
@VisitorFieldValidator(appendPrefix = false)
public Object getModel() {
    return yourBean;
}

Now do the normal validations using annotation.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top