0

I am making a url like this

url = new URL("http","localhost",9080,"/path/to/my/resource/myAction.action");

instead of making the url:

http://localhost:9080/path/to/my/resource/myAction.action

its making the request to:

http://www.localhost.com/path/to/my/resource/myAction.action
2
  • Are you sure.? Try to print the contents of url because when i tried printing the content of url it is http://localhost:9080/path/to/my/resource/myAction.action Commented Feb 13, 2012 at 23:18
  • tried that, print the wrong url for me.. Commented Feb 13, 2012 at 23:23

1 Answer 1

1

try this:

url = new URL("http://localhost:9080/path/to/my/resource/myAction.action");
Sign up to request clarification or add additional context in comments.

3 Comments

If you would like to keep the version you are using, I think it would work if you use 127.0.0.1 instead of localhost
I actually made an error typing in the URL, when testing this I left out the // after http: so the call was getting made to http:localhost:9080/path/to/my/resource/myAction.action, soon as I put in // it reverted to www.localhost.com URL :S
did you try 127.0.0.1 instead?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.