hi, I'm validating incoming attribute, but the validator catches even the other pages not annotated with @Valid
@RequestMapping(value = "/showMatches.spr", method = RequestMethod.GET)
public ModelAndView showMatchPage(@ModelAttribute IdCommand idCommand)
//etc
When I access page /showMatches.spr
I get the error org.springframework.web.util.NestedServletException: Request processing failed; nested exception is java.lang.IllegalStateException: Invalid target for Validator [cz.domain.controller.Controllers$1@4c25d793]: cz.domain.controller.IdCommand@486c1af3
,
The validator doesn't accept it, but I don`t want it to validate! By this validator:
protected void initBinder(WebDataBinder binder) {
binder.setValidator(new Validator() {
// etc.
}