Skip to content

Allow configuring RequestMappingHandlerMapping in mvc:annotation-driven [SPR-11253] #15878

@spring-projects-issues

Description

@spring-projects-issues

Baptiste Meurant opened SPR-11253 and commented

Since 3.2M2 and content negotiation improvements (cf. #13057), Spring allows to configure a ContentNegotiationManager on mvc:annotation-driven declaration :

<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager"/>

This is really useful to define a custom list of media types that Spring will recognize. Thank you for that.

But if we want to exclude from suffix pattern recognition any other media type extension, we have also to set to true the useRegisteredSuffixPatternMatch property of the RequestMappingHandlerMapping (see this comment).

Unfortunately, as far I know, there is no way to configure the RequestMappingHandlerMapping from mvc-annotation-driven and we have to override the entire mvc-annotation-driven configuration which is boring, verbose and unuseful.

Why do not provide a comparable way to configure RequestMappingHandlerMapping ? Is there a strong technical or conceptual reason ?

Could we write something like :

<mvc:annotation-driven content-negotiation-manager="contentNegotiationManager" request-mapping-handler="requestmappingHandler"/>

Affects: 3.2.6

Issue Links:

1 votes, 3 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