Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writing security manager for Applets

Status
Not open for further replies.

alebu

Programmer
Sep 7, 2002
46
The situation is next: I want my applet to listen to the port , but I got security exception. As I understand, I need to install my implementation of SecurityManager, but I don't know how :-( . So if U know how to do it, please write here or mail me. If you have any example of solving problems like THIS ( working with files from applets or something else ), then it EVEN BETTER to take a look on it !!! I've allready asked this question on javalobby but "best" answer a've got were "Perhaps your applet is not trusted!" I hope here i will got something more... :)
 
By nature of what applets are, the applet security policy they are never allowed to do certain actions - ie - access the native file system, or act as servers (ServerSocket).

Try servlets.

Sorry !

Ben
 
I think you'd need to edit the java.policy file of each client to do that. That way it would work. It's possible there are other ways, but I don't know them
 
Thank you all for your posts! To Chobito: Yes, I know about policy files, but its not what I need :-( Actually, any code is created not just for "be created" but for some reasons, in other words "because its doing something". And offcourse often we have alternative ways. So "making applet port listener" is one of solutions for my problem, but I am not sure that it is a right way. So I better discribe my problem and maybe you will know alternative solution! So...
Lets imagine situation then on some server ( yes, applet comes from this server and applet can establish connection with THIS server but... ) sometimes something happens and LOTS of applets need to be informed about that event ( not Java event, simply something ). Ofcourse I can make connection beetwin server andd each applet but as I know it will take lots of resourses to hold connection active ( Am I right ? if not, then my question has no sence at all :) ) But If such event happens only time to time ( not very often ) then maybe it is better to remember each applets that should be informed IP and send some code(information i mean) to him in case of event. In other words it is better to prevent 1000 applets to listen some port then hold connection with all of them! MAYBE I am comletely wrong about it, but I don't see any other possible solution, maybe your know? Anyway it is more teorical question for me so lets discuss it, OK ? :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top