java.net.URI resolve against only query string

前端 未结 2 648
心在旅途
心在旅途 2021-01-18 10:35

I\'m trying to build URI\'s using the JDK java.net.URI.
I want to append to an absolute URI object, a query (in String). In example:



        
2条回答
  •  醉话见心
    2021-01-18 11:22

    I'd like to respond myself. Javadoc really explains correctly. As URI#resolve() says, in section 3.b.:

    Otherwise the given URI's path is relative, and so the new URI's path is computed by resolving the path of the given URI against the path of this URI. This is done by concatenating all but the last segment of this URI's path, if any, with the given URI's path and then normalizing the result as if by invoking the normalize method.

    So.... I didn't read correctly. Should I delete this response? Or let it responsed by myself?

提交回复
热议问题