Skip to content

If you annotate any parameter in a @InitBinder method, it fails at runtime. [SPR-8946] #13586

@spring-projects-issues

Description

@spring-projects-issues

Ulon opened SPR-8946 and commented

Given the following init binder method:

@InitBinder()
protected void initBinder(WebDataBinder binder) {
    .....
}

if you annotate the binder parameter with, let's say, @Nonnull annotation (very useful for IDE inspection or unit testing) spring MVC is not capable to correctly resolve the parameter

@InitBinder()
protected void initBinder(@Nonnull WebDataBinder binder) {
    .....
}

Exception:

java.lang.IllegalStateException: No suitable resolver for argument [0] [type=org.springframework.web.bind.WebDataBinder]


Affects: 3.1.1

Referenced from: commits 03d6350, 2295372

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions