URLConnection getAllowUserInteraction Example
URLConnection class getAllowUserInteraction example. This example shows you how to use getAllowUserInteraction method.
URLConnection class getAllowUserInteraction example. public boolean getAllowUserInteraction() Returns the value of the allowUserInteraction field for this object.
Here is the code
/*
* @ # AddRequestProperty.java
* A class repersenting use to AddRequestProperty
* method of URLConnection class in java.net package
* version 23 June 2008
* author Rose India
*/
import java.net.*;
public class GetAllowUserInteraction {
public static void main(String args[]) throws Exception {
URL url = new URL("http://localhost:8080/net/listnets.jsp");
URLConnection connection = url.openConnection();
System.out.println("AllowUserInteraction "+
connection.getAllowUserInteraction());
connection.setAllowUserInteraction(true);
System.out.println("AllowUserInteraction "+
connection.getAllowUserInteraction());
}
} |
Output
AllowUserInteraction false
AllowUserInteraction true |
|