Link to home
Start Free TrialLog in
Avatar of wilsontang
wilsontang

asked on

Urgent Question

hi,
    How to call URL with https protocol?  Suppose changing the protocol will be fine.
I am using JDK1.2.2

My program is as follows:

URL url = new URL     ( "https", "10.10.10.1/template1/en/", 8888, "leftt1.htm"  );
URLConnection uc = url.openConnection();
uc.setDoOutput( true );
uc.connect();
InputStream in = uc.getInputStream();

The error message is unknown protocol.
ASKER CERTIFIED SOLUTION
Avatar of girionis
girionis
Flag of Greece image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rjackman
rjackman

y are u breaking ur url in parts try giving the continuous url
as
URL url = new URL     ( "https://10.10.10.1/template1/en:888/leftt1.htm);
i think this should work
cheers
RJ
1. is your program an applet or an application?
2. where do you get the exception?
3. post the exception details.

This is how I do it and it works:


URL url =
  new URL(protocol, serverIP, serverPort, serverPath);

where the parameters might be initialized as follows:

String protocol = "https";
String serverIP = "90.0.0.1";
String serverPort = "2020"; //?? your secure port
String serverPath = "/whatever/servletpath/servlet";

Hope that helps,
Rob