0
我想要生成以下路徑:'/ app#/ fragment1?test = toto' with spring library UriComponentsBuilder。UriComponentsBuilder查詢參數和片段
我迄今爲止嘗試:
UriComponentsBuilder ucb = UriComponentsBuilder.fromPath("/app").fragment("fragment1").queryParam("test","toto");
ucb.toUriStrong(); // -> gives me as result : '/app?test=toto#/fragment1'
任何想法如何以優雅的方式實現這一目標?
是的,你說得對,這就是我所做的。用查詢參數構建片段作爲UriComponent和完整路徑分開。我會接受你的回答 –