Skip to content

Support @HttpExchange in MvcUriComponentsBuilder#36580

Open
kwondh5217 wants to merge 1 commit intospring-projects:mainfrom
kwondh5217:gh-36235
Open

Support @HttpExchange in MvcUriComponentsBuilder#36580
kwondh5217 wants to merge 1 commit intospring-projects:mainfrom
kwondh5217:gh-36235

Conversation

@kwondh5217
Copy link
Copy Markdown
Contributor

MvcUriComponentsBuilder now recognizes @HttpExchange and composed
annotations such as @GetExchange in addition to @RequestMapping
when resolving class- and method-level mappings.

This allows controllers that implement @HttpExchange interfaces to use
fromController(), fromMethodName(), and fromMethodCall() to build links.

Closes gh-36235

MvcUriComponentsBuilder now recognizes @HttpExchange and composed
annotations such as @GetExchange in addition to @RequestMapping when
resolving class- and method-level mappings.

This allows controllers that implement @HttpExchange interfaces to use
fromController(), fromMethodName(), and fromMethodCall() to build links.

Closes spring-projectsgh-36235

Signed-off-by: Daeho Kwon <trewq231@naver.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 1, 2026
Copy link
Copy Markdown
Contributor

@DhruvTheDev1 DhruvTheDev1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice fix! Using AnnotatedElementUtils here seems right to make sure it picks up on the httpExchange mappings when they're defined on the parents interface which is how the docs suggest using them. Nice testing too especially on the PersonHttpExchangeControllerImpl to verify the inheritance works as expected. Also nice on updating the error message to include httpExchange which will save time debugging.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: waiting-for-triage An issue we've not yet triaged or decided on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HttpExchange equivalent of MvcUriComponentsBuilder

3 participants