java - spring mvc的validator如何支持String类型的参数
PHP中文网
PHP中文网 2017-04-18 09:33:54
0
1
649
PHP中文网
PHP中文网

认证高级PHP讲师

reply all(1)
小葫芦

Use @Valid to mark the parameter vStr to be verified. When you need to use JSR-303 in SpringMVC, you need to provide an implementation of the JSR-303 specification. Hibernate Validator implements this specification. The verification of JSR-303 is based on annotations, and a series of restriction annotations have been defined internally. We only need to mark these annotations on the attributes of the entity class that need to be verified or on their corresponding get methods.
You have not implemented it, so of course there will be no verification.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template