Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
使用 UriBuilder 如下:
UriBuilder.fromResource(My.class).path("resource").build().toString()
生成/my/resource.
/my/resource
我想知道是否有办法告诉 UriBuilder 我想生成这样的相对路径my/resource。这在我想发布相对于根 URI 的资源 URI(/my/resource作为绝对路径和根方案 + 域 + 端口的相对 URI)的情况下很有用。
my/resource
我的问题甚至有意义吗?