I m linux user... Developing my project in Eclipse IDE. and the project structure folder is Merchant.com(my project name)-->WebContent-->pg(folder)-->index.html(file).
My code ispublic class Url { /** * @param args */ public static void main(String[] args) { try { // // Creating a url object by specifing each parameter separately, including // the protocol, hostname, port number, and the page name // URL url = new URL("http", "www.Merchant.com" , 80, "/pg/index.html"); //URL url = new URL("http://Merchant.com/index.html"); // We can also specify the address in a single line. //www.merchant.com/pg/index.html BufferedReader reader = new BufferedReader(new InputStreamReader(url.openStream())); String line; while ((line = reader.readLine()) != null) { System.out.println(line); } reader.close(); } catch (MalformedURLException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } } }
I m run this project on tomcat server so that the folder structure is mycomputer-->usr-->shear-->Apachetomcat-->webapps-->MyProject(created manually by me)-->Merchant.com so my question is where do i put index.html? Am i missing something?
Thanks