문제

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?

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top