aspose file tools*
The moose likes Applets and the fly likes Applet-servlet communication Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Applets
Bookmark "Applet-servlet communication" Watch "Applet-servlet communication" New topic
Author

Applet-servlet communication

Atul Mishra
Ranch Hand

Joined: Jun 08, 2006
Posts: 140
All,
I have my applet running in localmachine and servlet on a remote machine[lets call it http://host.xxx.com:8080

When I try to communicate these two I get this exception:
java.security.AccessControlException: access denied (java.net.SocketPermission host.xxx.com:8080 connect,resolve)

My servlet runs in tomcat.

What can I do to solve this ? I tried starting tomcat with securitymanager enabled[by giving -security], that didnt help.
What else can I try ?

Thanks,
Atul
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42947
    
  70
An applet can only connect to the host where it's served from, so if it is hosted on localhost, then it will not be able to connect to any other machine. The way around that is to either sign the applet, or fiddle with your local security policy. Both approaches are HowCanAnAppletReadFilesOnTheLocalFileSystem]described here[/url].
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet-servlet communication