From 6326eb5642d3c0b9fa4ec4e23ea88d18d9190aff Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Fri, 11 May 2012 18:14:51 +0300 Subject: [PATCH] Updated documentation. Clarify how ControllerLinkBuilder actually works internally. --- readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.md b/readme.md index ec6863db..534c73cc 100644 --- a/readme.md +++ b/readme.md @@ -94,8 +94,8 @@ Link link = linkTo(PersonController.class).withRel("people"); assertThat(link.getRel(), is("people")); assertThat(link.getHref(), endsWith("/people")); ``` - -You can now easily build more nested links as well: +`` +The `ControllerLinkBuilder` uses Springs `ServletUriComponentsBuilder` under the hood to obtain the basic URI information from the current request. Assuming your application runs at `http://localhost:8080/your-app` This will be exactly the URI you're constructing additional parts on top. The builder now inspects the given controller class for its root mapping and thus end up with `http://localhost:8080/your-app/people`. You can also easily build more nested links as well: ```java Person person = new Person(1L, "Dave", "Matthews");