Example:
public String getStudentResult(@RequestParam(value = \"regNo\", required = true) String regNo, ModelMap model){
How can I use @v
one way to do it is to write a Wrapper Bean like the following :
public class RegWrapperBean{
@NotNull
String regNo ;
public String getRegNo(){
return regNo ;
}
public void setRegNo(String str){
this.regNo=str;
}
}
and your handler method will be like the following :
@RequestMapping(value="/getStudentResult", method=RequestMethod.POST)
public String getStudentResult(@Valid @ModelAttribute RegWrapperBean bean,
BindingResult validationResult, Model model) {
}
and please refer to these answers here and here .
Hope that Helps .