Solved

Security exception, only inside the web page: why?

Posted on 2002-05-30
9
194 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
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

 
LVL 92

Expert Comment

by:objects
ID: 7046353
0
 
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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Application launch issue with Apache Tomcat 5 44
topping3 challenge 14 80
Java - Why doesn't this JFrame work 3 59
jsp insert to database example 2 24
Java Flight Recorder and Java Mission Control together create a complete tool chain to continuously collect low level and detailed runtime information enabling after-the-fact incident analysis. Java Flight Recorder is a profiling and event collectio…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

773 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