I am writing the following code... But i am getting an error as...
java.io.FileNotFoundException: http:// localhost:8080/geoserver/ at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1613) at Try.main(Try.java:25)
Am i doing it right? I am new at this geoserver as well as client server coding...
import java.io.*;
import java.net.*;
public class Try{
public static void main(String args[]) throws Exception{
URL hp= new URL ("http://localhost:8080/geoserver");
try {
URL myURL = new URL("http://localhost:8080/geoserver/");
URLConnection myURLConnection = myURL.openConnection();
myURLConnection.connect();
BufferedReader in = new BufferedReader(new InputStreamReader (myURLConnection.getInputStream()));
String inputLine;
while((inputLine = in.readLine()) != null )
{
System.out.println(inputLine);
}
in.close();
}
catch (Exception e){
System.out.println("Into CATCH");
e.printStackTrace();
}
}
}