I'm working in web application. Server used is Apache Tomcat 6. I tried to access resource from mylocalhost http://localhost:8080/examples/README.txt
after running the server. But I can't access the resources showing the error message file not found from the Eclipse. But if I press ctrl+left click on the link, the resource was opening in Eclipse work area. The same resources I can access without going through the server, i.e going to path C:\Program Files (x86)\apache-tomcat-6.0.35\bin
and clicking Startup.bat
. By this way I can open the file. May I know what is reason for not accessing that resources through Eclipse?
url = new URL("http://localhost:8080/examples/README.txt");
con = url.openConnection(); // open the url connection.
dis = new DataInputStream(con.getInputStream());