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.
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.