I am developing an application in which an applet after downloading in the browser attempts to open URLConnection and read data through InputStream, but at the line where applet try to connect to servlet, it gives Access control error and access denied message.I am using Tomcat v3.1.Please tell me how to solve that problem.I will be thank ful.
Joined: Jun 22, 2001
Hi, I am not sure if I have got ur problem correct.But I would like to point out one thing.Applet can connect to only that server from which the applet was downloaded.Due to security considerations it cannot connect to any other server. You will have to use getCodeBase()(or something similar.i dont remember the exact method) to find out the server name from which the applet was downloaded and then use the return value to connect to the servlet. hope this helps. Subbu
Joined: May 13, 2001
I have used getCodeBase() but when i use appletviewer to run the applet it gives "java.security.AccessControlException access denied(java.io.FilePermission) on servlet/serv-name.java" in both cases(whether the tomcat is running or not) at the point where the applet tries to open connection with servlet(Http based communication) using URL & URLConnection.But when i run the applet embeded in HTML in browser, it gives no message in tomcat window and does not retrive the data from servlet.Also please tell me how can we increase and decrease the security both in browser and appletviwer case.One more thing, i am using IE5 and i read that there is problem with ports in IE5 in case of applets.Plz tell me how to slove this,I will be gratful.