Java:在另一个中嵌入一个URL

时间:2013-11-06 02:40:14

标签: java url

我有一个网址,我需要包含在另一个网址中。到目前为止,我有:

String urlString = "http://company.com/action?sourceUrl=http://stackoverflow.com/foo"
URL url = new URL(urlString);

如何确保此网址不会搞砸?我的意思是,例如,如果我需要另一个参数怎么办:

String urlString = "http://company.com/action?sourceUrl=http://stackoverflow.com/foo&count=1"
URL url = new URL(urlString);

现在这是模棱两可的。 count是属于外部URL还是内部?我如何解决这种情况,一般在另一个URL中,然后在Java中发出请求?

0 个答案:

没有答案