Solved

Urgent Question

Posted on 2001-06-04
4
224 Views
Last Modified: 2010-03-31
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.
0
Comment
Question by:wilsontang
4 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 100 total points
ID: 6152076
0
 
LVL 3

Expert Comment

by:rjackman
ID: 6152107
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
0
 
LVL 4

Expert Comment

by:rdov
ID: 6152368
1. is your program an applet or an application?
2. where do you get the exception?
3. post the exception details.

0
 
LVL 3

Expert Comment

by:rkenworthy
ID: 6157398
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
0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Should localization be done inside spring controller 5 37
runtime exception 2 50
Java Eclipse Loop 3 31
Strange router problem - can't access hotmail.com 14 58
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

697 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question