This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
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 Android Security Essentials Live Lessons this week in the Android 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: 41155
    
  45
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 - my free Android networking tools app
 
jQuery in Action, 2nd edition
 
subject: Applet-servlet communication
 
Similar Threads
applet and servlet not communicating... any ideas?
Problem accessing servlet through Tomcat 5.0.28
Tomcat Server can't load himself (without using localhost)
Tomcat issues
Tomcat, JSP and Applet