I have a url I need to include in another. So far I have:
String urlString = "http://company.com/action?sourceUrl=http://stackoverflow.com/foo"
URL url = new URL(urlString);
How can I make sure this url does not get messed up? I mean for example, what if I need another parameter:
String urlString = "http://company.com/action?sourceUrl=http://stackoverflow.com/foo&count=1"
URL url = new URL(urlString);
This is now ambiguous. Does count belong to the outer URL, or inner? How do I solve this situation, and in general up one URL in another and then issue the request in Java?