File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Java » Servlets
Bookmark "Security error from web server" Watch "Security error from web server" New topic

Security error from web server

Nasir Mkhan

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
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.

Nasir Mkhan

Joined: May 13, 2001
Posts: 28
I have used getCodeBase() but when i use appletviewer to run the applet it gives
access denied( on servlet/"
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.
I agree. Here's the link:
subject: Security error from web server
It's not a secret anymore!