0
Struts2를 사용하는 동안 set()
메서드에서 Model 클래스 내에서 유효성 검사를 수행하기 위해 여러 주석을 사용하고 있습니다.유효하지 않은 Chars에 대한 Struts2 Annotation-Validators
@RequiredStringValidator(message = "Name is required")
@StringLengthFieldValidator(message = "Name must be between 5 and 60 characters",
minLength = "5", maxLength = "60")
public void setName(String name) {
this.name = name;
}
그러나 유효성 검사를 수행하는 방법을 원합니다. !
, ?
, #
, $
등 ...
@RestrictChars
과 같이 사용해야하는 기존 유효성 검사기가 있습니까? 아니면 @StringRegexValidator
을 사용할 수있는 방법이 있습니까? 아니면 새로운 것을 써야합니까? 어떤 힌트 나 문서로 그렇게하는 것이 좋습니다.