Skip to content

@RequestMapping should support alternative between a header and a url extension [SPR-7722] #12378

@spring-projects-issues

Description

@spring-projects-issues

Stefan Schmidt opened SPR-7722 and commented

It would be nice if we can support request mappings in MVC controllers which kicks in if either a header is present (ie headers = "Accept=application/json") or a URL extension is used (ie /owners/1.json). While this scenario is currently possible with the ContentNegotiatingViewResolver it is not possible to configure the same effect through @RequestMapping in conjunction with @ResponseBody.

From a Spring Roo perspective this would be a nice feature to have. I was thinking if I could define a SPEL expression in some way in the @RequestMapping annotation that would be nice.

There are two other SPR tickets which are related to this: #11163 and #12012


Affects: 3.1 M1

Issue Links:

Referenced from: commits f94aed8, f05e2bc

1 votes, 2 watchers

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)status: duplicateA duplicate of another issuetype: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions