Solved

Security exception, only inside the web page: why?

Posted on 2002-05-30
9
208 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
[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
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
MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

 
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ejb example issues 3 88
Eclipse for Java EE development 2 67
Website checklist for browser compatibility? 2 56
junit initializtion error 2 20
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…
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 “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…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Suggested Courses

737 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