hibernate validator - can @Email and spring custom validation coexists? -


I have to validate the email and password when creating an account using web services. I am using Spring Rest Controller and are planning to use @Email (Hibernate Vector) annotation for e-mail verification. For password verification, I have to write the custom verifier by implementing the Verifier interface.

  @xml Arrayment Element Public Class Account Tools SerialJobile {@Email (Message = AccountErrorcode.ACACACACAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA); Private string password;  

For a password writing your validation

  @Autowired Private PasswordViditor passwordLegal; @InitBinder Private Zero initBinder (WebDataBinder Binder) {binder.setValidator (passwordValidator); }  

It seems that the two can not be together. When I try to authenticate the email ID spring passwordValidator calls but fails to validate email I expect failure due to wrong email ID when I disable custom verifier, I get the required error message is.

It seems I'm missing something, do I need to do something to do this work? Or is it not supported? If it is not supported then can I stop the Hibernect Vector from the Constant Custom Vedicator writing my own approval for email? Instead of giving injection to your custom verifier in your controller, a special @password

Create a comment to use as a validation. Remove any barrier logic from the controller and do it in your Dto class. Something like this:
  @Target ({METHOD, FIELD, ANNOTATION_TYPE}) @Resetton (RUNTEE) @ Consultant (valid = PasswordWidid class) public @ interface password {string message (default) " {Invalid Password}"; Classroom & lt ;? & Gt; [] Group () default {}; For class & lt;? Payload & gt; [] Expands the payload () default {}; }  

You will find the load of tutorials for custom annotations that have been validated on your own. Hope that helps


Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -