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
Post a Comment