Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Urgent Question

Posted on 2001-06-04
4
Medium Priority
?
239 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 200 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses

636 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