Applet connecting to a Server

P

paul.foreman

Hi,
I am novice at Java and Applets.

I am working on a project and have developed a server which access a
database.

I then constructed an applet which connects to a socket generated by the
server and sends a string to the server - the server responds with a return
of some string information.

The applet works with no problems when on the same PC. When I access the
applet from another PC on the same LAN the applet does not appear to connect
to the server. I have tried a number of different ways of addressing the
Server Socket with no result yet.

Do you please have any suggestions as to why the applet is failing to
connect to the server socket?

Paul
 
M

Manish Hatwalne

As a security measure, an unsigned applet can only connect to the server
from which it has been downloaded.
In other words, you must have your server and applet hosted on the same
server, of course applet itself can be launched on any machine by embedding
it in an HTML page.

HTH,
- Manish
 
P

paul.foreman

Manish,

Thank you for your reply.

I have both the server and the applet resident on the same PC.

I start the applet by opening the html page which has the applet stored
within it. The applet appears to work by performing some data validation
when I input a number, but does not actually connect to the server when it
needs to. The applet has been developed in a different project and package
than the server software - does this make any difference?

Should this work ok from an applet security point of view?

Regards

Paul
 
P

paul.foreman

Manish,
I have tracked down the problem and fixed it.

It was a Java security problem, even though the server and the applet were
on the same PC.

Once I addressed the applet using the HTML reference via the server it
worked fine.

Thanks again

Paul
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,044
Latest member
RonaldNen

Latest Threads

Top