Skip to content

Provide way in MVC Java config to modify rather than replace default HandlerExceptionResolvers [SPR-13931] #18503

@spring-projects-issues

Description

@spring-projects-issues

Bill Chen opened SPR-13931 and commented

Currently, if one configures a resolver with WebMvcConfigurerAdapter.configureHandlerExceptionResolvers(), the default ones will not be added. And since WebMvcConfigurationSupport.addDefaultHandlerExceptionResolvers() is not directly accessible, one has to copy code from that method to manipulate the defaults.

Fundamentally, this way of registering resolvers (by adding them to a list which is then used to build a HandlerExceptionResolverComposite) is really unnecessary because Spring MVC can use multiple HandlerExceptionResolver beans in the context anyways.

Can the default ones be exposed as normal beans with enough gaps in their default order instead?

Alternatively, at least provide a way to insert resolvers in between the defualt ones like the extendMessageConverters() method.


Referenced from: commits d53c04b

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