Java – @ requestparam validation
•
Java
Is there a way to validate a request parameter with spring without checking it in every function?
Solution
If you use @ requestbody to use the form support object, you can use jsr-303 bean validation, where you can annotate the form bean For more information, see http://static.springsource.org/spring/docs/current/spring-framework-reference/html/validation.html#validation -beanvalidation. Then you don't need to disturb the validator object or other code - you just comment
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码