wood burning stoves 2.0*
The moose likes Servlets and the fly likes Security error from web server 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 "Security error from web server" Watch "Security error from web server" New topic
Author

Security error from web server

Nasir Mkhan
Greenhorn

Joined: May 13, 2001
Posts: 28
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.
Subbu Aswathanarayan
Ranch Hand

Joined: Jun 22, 2001
Posts: 73
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


Subbu
Nasir Mkhan
Greenhorn

Joined: May 13, 2001
Posts: 28
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.
 
jQuery in Action, 2nd edition
 
subject: Security error from web server
 
Similar Threads
Applet-Servlet , AttributeValues does not work in browser
Java.Net.SocketException: Option unsupported by Protocol: Create
I can't access mysql db from applet.
access control exception
problems naming a host parameter