@RequestParam(value = "param") String param
How to validate this param in elegant way ? More exactly I must check if param
is some value in database. My stack is: spring-boot+mybatis
@RequestParam(value = "param") String param
How to validate this param in elegant way ? More exactly I must check if param
is some value in database. My stack is: spring-boot+mybatis
This might be a duplicate of that one but anyway.
There's a difference in the way you validate forms and separate parameters. With POST it's actually impossible to break the request into separate parameters and you get the whole post body, and you use @Valid to process it. With GET it is possible to have separate parameters as arguments in method, and in this case Spring proprietary @Validated annotation should be used.