嗨,如何使用“ http://test.com/#/signup ”成功创建UriComponentsBuilder ?以下代码将抛出无效的HTTP URL。
UriComponentsBuilder builder = UriComponentsBuilder
.fromHttpUrl("http://test.com/#/signup");
您可以尝试先构建URI
,然后使用它来初始化构建器:
URI uri = new URI.create("http://test.com/#/signup");
// hash part going to be available like this
String fragment = uri.getFragment();
UriComponentsBuilder builder = UriComponentsBuilder.fromUri(uri);
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句