Member Avatar for masterofpuppets

Hi all,

Here's the problem I have. I am designing a website in HTML and I want to include a chat system using a Java applet. I have written a small example applet that just connects to my server and gets the users that are currently online. The applet works when I run it in Eclipse but I tried to launch it from the browser and I got a SocketPermission exception.

I did some reading on the subject and found out that I need to make some changes to the java.policy file in order to grant my applet access to the socket. Also I found a couple of discussions here in the forum but couldn't find anything that actually describes the process of signing the applet. I read something about using a JAR file to include all files that the applet needs (including a java.policy file) but I am not sure how to do that. In addition, I read that the policy file is contained in the Java directory on each client's machine. So my question is how can I connect my applet to the server without having the user download a policy file or having to do any configurations?

Recommended Answers

All 3 Replies

Where are all the parts of your application(applets, html, server) and how do they communicate?
An applet can connect to the server it was loaded from.
Are you trying to connect with another server from your applet?
What code do you have on the server to control the chat sessions?

Member Avatar for masterofpuppets

Thanks for the links :) I checked them out but I decided to use Javascript and Ajax for the chat system.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.