【发布时间】:2014-09-11 21:53:23
【问题描述】:
有人可以向我解释一下“localhost”将如何输入到 {host} 中,“1234”将如何输入到 {id} 中吗?
引用:
Link.Builder 有一个底层的 UriBuilder。传递给 build() 的值 方法被传递给此 UriBuilder 以创建链接的 URI。我们看看吧 举个例子:
Link link = Link.fromUri("http://{host}/root/customers/{id}")
.rel("update").type("text/plain")
.build("localhost", "1234");
在链接实例上调用 toString() 将导致:
<http://localhost/root/customers/1234>; rel="update"; type="text/plain"
结束报价
谢谢
【问题讨论】:
标签: resteasy