Solved

Java security within a browser

Posted on 1998-02-16
3
153 Views
Last Modified: 2010-04-16
Hm... I am pretty new to java. I was pretty much surprised after a couple of days of work to find out that simple

Socket s = new Socket ("somewhere.com", PORT);

doesn't work!!! Neither IE nor Netscape. The latter throws a security exception, and the former one just gets stuck! Don't tell me I can't create a socket when running an applet form a browser?!?!?!

Is there a way to solve this?
0
Comment
Question by:shaqshup
3 Comments
 
LVL 5

Accepted Solution

by:
fontaine earned 30 total points
ID: 1233071
You can only open a socket to the machine that has served your applet. That's the rule. So, if your applet comes from A.com, you can't open a socket to B.com.

The only work-around is at the server-side. For example, write a CGI script that opens the stream for you and forward it to your applet.
0
 

Expert Comment

by:ashexpert
ID: 1233072
alternatively you need to have signed applets

and insted of CGI script sbetter alternative is servlets!
0
 

Author Comment

by:shaqshup
ID: 1233073
What are servlets? And how do you make signed applets? CAB files, or something else?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Requested array size exceeds VM limit 3 84
print map entry 34 55
servlet  URL Rewriting 1 27
Windows 10 IE Certificate Issue 10 42
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

895 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now