我正在制作这样的网址
url = new URL("http","localhost",9080,"/path/to/my/resource/myAction.action");
而不是制作网址:
http://localhost:9080/path/to/my/resource/myAction.action
其请求:
http://www.localhost.com/path/to/my/resource/myAction.action
最佳答案
试试这个:
url = new URL("http://localhost:9080/path/to/my/resource/myAction.action");
关于java - 格式错误的 Java Net URL,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9269402/