Hello, I have written an applet in which i am trying to connect to a server using
URL u = new URL("http://www.google.com/"); System.out.println("Host...."+u.getHost()); HttpURLConnection uc = (HttpURLConnection) u.openConnection(); retval=uc.getResponseCode();
The code throws java.lang.ClassCastException: com/ms/net/wininet/http/HttpURLConnection at run time. The reason i found is that different browser and their versions do not to return the same java.net.HttpURLConnection on URL.openConnection. e.g. in case of IE it returns com.ms.net.wininet.http.HttpURLConnection.
Since the applet code will run on different browser with different version. Is there a way around to solve this issue. :roll: Also how to check for the connection with a specific remote server if the client browser setting is through proxy?? Thankyou for ur interest and time Best Regards Lusha