-
Notifications
You must be signed in to change notification settings - Fork 472
ControllerLinkBuilder.linkTo throws error if called outside of the context of a HTTP request #408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Milestone
Comments
nickgrealy
added a commit
to nickgrealy/spring-hateoas
that referenced
this issue
Oct 26, 2015
Changed linkTo so that it can be invoked outside of a HttpRequest - issue spring-projects#408. Added linkTo method, which takes an explicit UriComponentBuilder.
👍 super useful |
gregturn
added a commit
that referenced
this issue
May 25, 2017
gregturn
added a commit
that referenced
this issue
May 25, 2017
gregturn
added a commit
that referenced
this issue
May 25, 2017
gregturn
added a commit
that referenced
this issue
May 25, 2017
odrotbohm
pushed a commit
that referenced
this issue
Jul 27, 2017
odrotbohm
added a commit
that referenced
this issue
Jul 27, 2017
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current Behaviour
Given the latest spring hateos dependency
org.springframework.hateoas:spring-hateoas:0.19.0.RELEASE
,When I attempt to use the
ControllerLinkBuilder.linkTo
method (outside of the context of a HTTP request),Then I get the following exception:
Proposed Behaviour
Instead of the exception, I'd expect to receive a relative URL (preferably including the context-path).
e.g. Instead of
http://localhost:8080/myappscontext/mycontroller/mymethod/pathvar/foo?a=1
, I'd receive/myappscontext/mycontroller/mymethod/pathvar/foo?a=1
Additionally, it'd be excellent if I could specify my own
UriComponentsBuilder
to be used for building the URI.e.g.
Related
The solution proposed should (at least partially) also address these similar issues:
The text was updated successfully, but these errors were encountered: