Win a copy of Android Programming: The Big Nerd Ranch Guide this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Applet-servlet communication  RSS feed

 
Atul Mishra
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 42972
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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].
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!