For some reason when I try and hit even a simple webapp running on my local machine using HttpURLConnection, I keep getting a 404 reponse code. What's throwing me for a loop is that I can hit other URL's such as google and I was able to hit a local grails app that's running on Jetty. But, if I try to hit even a simple html file running from a war that's running on Tomcat 6, I get the 404. And this is a URL that I am able to hit through a browser.
Here is my code:
url = new URL("http://localhost:8080/simpleweb/index.html/");
connection = (HttpURLConnection) url.openConnection();
Does anyone have any ideas on something else to check?
Yeah, that's what's maddening about this. I can hit the URL in a browser. Plus, I can hit other URL's like "http://www.google.com" using HttpURLConnection just fine. It's just when I try to use it to hit my URL on localhost that's running off of Tomcat...the exact same URL that worked in the browser.