Example:
public String getStudentResult(@RequestParam(value = \"regNo\", required = true) String regNo, ModelMap model){
How can I use @v
@Valid can be used to validate beans. I have'nt seen it used on single string parameters. Also it requires a validator to be configured.
The @Valid annotation is part of the standard JSR-303 Bean Validation API, and is not a Spring-specific construct. Spring MVC will validate a @Valid object after binding so-long as an appropriate Validator has been configured.
Reference : http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html