import java.net.*;
public class allowUserInteraction {
public static void main(String[] args) {
URL u;
URLConnection uc;
myHttpHandler handler;
try {
u = new URL("http://www.ora.com");
handler = new myHttpHandler();
uc = handler.openConnection(u);
if (!uc.getAllowUserInteraction()) {
uc.setAllowUserInteraction(true);
}
}
catch (MalformedURLException e) {
System.err.println(e);
}
catch (IOException e) {
System.err.println(e);
}
}
}
class myHttpHandler extends sun.net.www.protocol.http.Handler {
public URLConnection openConnection(URL u) {
return super.openConnection(u);
}
}
|