spring-projects / spring-projects/spring-hateoas

Add an extension point to customize base uri for WebMvcLinkBuilderFactory#linkTo calls

Open
#1,987 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
1.1k
Forks
476
PR merge metrics
No merged PRs in 30d

Description

Hi,

When http requests are made by a servlet that is not Spring MVC servlet the servlet path is missing in URI created with call to WebMvcLinkBuilderFactory#linkTo(java.lang.Object).
It's also the case when the calls are not in a http request thread (even the context path is missing in this case).

Is it possible to provide an extension point to be able to customize the base URI path ?

Thanks !

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with WebMvcLinkBuilderFactory#linkTo(java.lang.Object) and trace how its base URI is obtained. Define an extension point that supports servlet paths outside Spring MVC and calls without an HTTP request, then verify that both cases can customize the generated URI.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.