SPR-8020 Support UriComponentsBuilder as a controller method argument.

The UriComponentsBuilder instance passed into the method is initialized
with current request information including host, scheme, port, context
path, and the servlet mapping's literal part.

Also added shortcut methods to buildAndExpand in UriComponentsBuilder.
This commit is contained in:
Rossen Stoyanchev
2011-11-18 14:36:44 +00:00
parent e4fada56ab
commit 60ee0bb8f4
10 changed files with 210 additions and 12 deletions

View File

@@ -1199,6 +1199,13 @@ public class RelativePathUriTemplateController {
indicated by the <classname>@SessionAttributes</classname>
annotation at the handler type level.</para>
</listitem>
<listitem>
<para><classname>org.springframework.web.util.UriComponentsBuilder</classname>
a builder for preparing a URL relative to the current request's
host, port, scheme, context path, and the literal part of the
servlet mapping.</para>
</listitem>
</itemizedlist></para>
<para>The <interfacename>Errors</interfacename> or