Skip to content

Allow custom WebArgumentResolvers to be configured using the mvc namespace [SPR-7327] #11986

@spring-projects-issues

Description

@spring-projects-issues

Keith Donald opened SPR-7327 and commented

Currently there is no easy way to configure WebArgumentResolvers and use the namespace. You can write a BeanPostProcessor to change AnnotationMethodHandlerAdapter after construction, but its API does not allow you to add a resolver, only set the entire collection. The other option is to not use mvc:annotation-driven.

A child element of mvc:annotation-driven should do the trick:

<mvc:annotation-driven>
    <mvc:custom-web-argument-resolvers>
        <bean class="org.example.MyWebArgumentResolver"/>
    </mvc:custom-web-argument-resolvers>
</mvc:annotation-driven>

Affects: 3.0.3

Referenced from: commits 37e0a90, 7aaad37

1 votes, 1 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions