Solved

Security exception, only inside the web page: why?

Posted on 2002-05-30
9
172 Views
Last Modified: 2010-03-31
I've an applet that open a socket with the server to read datas.

This class runs good in the appletviewer, but if i open the HTML page witch have the applet inside, i have a Security exception.

What's wrong?
0
Comment
Question by:fab1970
9 Comments
 
LVL 92

Expert Comment

by:objects
ID: 7045789
Applets can only make network connections to the server that they were loaded from.
0
 

Author Comment

by:fab1970
ID: 7046345
Right. So my applet connect to my PC ip address.

I've build a supertiny winsock "bridge" with VB (that i know a lot more!): it listen on my pc ip address, connect to a intranet ip address, and echoes everything.

The question is always the same: if my applet (that is loaded from my pc) can open a connection with my pc in the applet viewer, why it can't from the HTML page?
0
 
LVL 92

Accepted Solution

by:
objects earned 300 total points
ID: 7046350
Because applet viewer has less security restrictions than IE or NS.
0
 
LVL 92

Expert Comment

by:objects
ID: 7046353
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 92

Expert Comment

by:objects
ID: 7046356
You can remove this restriction by 'signing' the applet.
0
 
LVL 16

Expert Comment

by:heyhey_
ID: 7046655
> I've an applet that open a socket with the server to read datas.

usually applet is allowed to open sockets to it's web server machine only.

new Socket(getCodeBase().getHost(), port) should work fine.
0
 
LVL 92

Expert Comment

by:objects
ID: 7048204
0
 
LVL 35

Expert Comment

by:girionis
ID: 8813336
No comment has been added lately, so it's time to clean up this TA.

I will leave a recommendation in the Cleanup topic area that this question is:

- points to objects@idg

Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

girionis
Cleanup Volunteer
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
scoreUp challenge 14 48
sumHeights2  challenge 7 76
where is session ID cache stored 1 39
for i loop in grovy 1 32
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
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…
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:
This video teaches viewers about errors in exception handling.

760 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

25 Experts available now in Live!

Get 1:1 Help Now