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


Win a copy of Java 8 in Action this week in the Java 8 forum!
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: 39573
    
  27
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].


Ping & DNS - updated with new look and Ping home screen widget
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Applet-servlet communication
 
Similar Threads
Tomcat issues
Problem accessing servlet through Tomcat 5.0.28
applet and servlet not communicating... any ideas?
Tomcat, JSP and Applet
Tomcat Server can't load himself (without using localhost)