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

xslt - DocBook 5 to PDF transform failing with error: "fo:flow" is missing child elements. Required content model: marker* -

mediawiki - How do I insert tables inside infoboxes on Wikia pages? -

Local Service User Logged into Windows -