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 Servlets and the fly likes Newbie Question 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 » Servlets
Bookmark "Newbie Question" Watch "Newbie Question" New topic
Author

Newbie Question

Dave Wingate
Ranch Hand

Joined: Mar 26, 2002
Posts: 262
Hello,
I've been try to write a simple Applet / Servlet combo that can communicate with each other and I've hit a problem. When, from the Applet, I open a URLConnection to the Servlet running on tomcat, all seems to go well. However, when I go the further step to try to get an inputstream from the connection, I get the following error:
java.security.AccessControlException:
access denied(java.net.SocketPermission localhost resolve)
I'm wondering what is really going on here. Is the problem that I'm viewing the Applet page as a localhost? Do I need to change the configuration of tomcat?
Any help or advice would really be appreciated.


Fun programming etcetera!
arun mahajan
Ranch Hand

Joined: Dec 07, 2001
Posts: 305
The problem is that Java SandBx does not allow a simple applet to communicate for such security issues...there are two workaround:-
1. Make your applet signed one...the other problem here would be signing separately for Netscape and IE...can get some info on net for same...I had some link will post ASAP
2. Perhaps other way is to make another class in applet as standalone app and than communicate through this to Servlet...
Hope this may help...all the best

regards,
arun
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Newbie Question
 
Similar Threads
Applet using Apache on XP - not loading on remote host
Why my servlet is not answering when I try to send an object?
Having Classpath trouble on my new iMac
Forms Listener Servlet
Tomcat endorsed and JAVA_OPTS