I have a problem with URL and relative path (query). I wrote this code to get absolute url from relative url:
old = "http://domain/script?param";
new_ = "?otherparam";
URL u = new URL(old);
u = new URL(u,new_);
Here is output:
JAVA URL: http://domain/script?param + ?otherparam = http://domain/?otherparam
FireFox: http://domain/script?param + ?otherparam = http://domain/script?otherparam
Why does URL's result differ from FireFox? How to build URL like FireFox does?