java - Why can't I use Valid parameter along with RequestParam in Spring MVC? -



java - Why can't I use Valid parameter along with RequestParam in Spring MVC? -

example:

public string getstudentresult(@requestparam(value = "regno", required = true) string regno, modelmap model){

how can utilize @valid regno parameter here?

@valid can used validate beans. have'nt seen used on single string parameters. requires validator configured.

the @valid annotation part of standard jsr-303 bean validation api, , not spring-specific construct. spring mvc validate @valid object after binding so-long appropriate validator has been configured.

reference : http://docs.spring.io/spring/docs/current/spring-framework-reference/html/validation.html

java spring spring-mvc java-ee annotations

Comments

Popular posts from this blog

php - How to pass multiple values from url -

database - php search bar when I press submit with nothing in the search bar it shows all the data -

ios - How to load .png images from Documents folder of an app -