开发者

Java library/class to parse clean URLs and get its different components [closed]

开发者 https://www.devze.com 2022-12-21 03:13 出处:网络
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. 开发者_如何学运维

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

Improve this question

I am looking for a java library/class to parse clean URL's and get all the properties like query, port, host , domain, subdomain etc. Essentially most of the functionality that java.net.URI does but even for clean URLs. I am guessing since this is a pretty common requirement, there might be some libraries already built to handle this. Help?


java.net.URL class has methods getHost(), getPort(), getQuery(), getPath().

You can also look at URI class, it's more preferred to use it.


The standard Java Url classes do not have functionality to parse request parameters. There is a utility class in Commons HTTP Client which has a useful method to do this.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号