Standard Java Class for common URL/URI manipulation

后端 未结 3 1392
一生所求
一生所求 2021-02-05 11:12

This question has almost certainly been asked before, but I ask it anyway because I couldn\'t find an answer.

Generally, is there a utility class of some sort that assis

3条回答
  •  -上瘾入骨i
    2021-02-05 11:32

    This does not answer OP's question directly (i.e. it's not a generic, all-around library for URL manipulation), but: if you're going to be using Spring anyway, you might as well consider the ServletUriComponentsBuilder and UriComponentsBuilder classes (see here and here for javadocs).

    I believe they are bundled with the spring-web dependency. IMHO, these offer quite a few convenient utility methods for working with URIs, URLs and query parameters.

提交回复
热议问题