can an applet make a network connection to the host computer
posted 15 years ago
hi, can an applet make a network conectin to the host computer.iam using JRE1.3 in my applet.my applet reads a file in the host computer.but iam getting an erro which looks like eror:java.security.AccessControlException:AccessDenied(java.io.FilePermission/hostcomputer/applicationfolder/*.dat) iam unable to read the file from the host computer. anyone please help.this is very urgent. thanks and regards, ravikumar
You didn't say how you were getting the data, so I'm assuming that you are attempting to open the file from a LAN server rather than download it from an HTTP server. Not only can you not do this, you also can't open a file local to your own computer -- the "sandbox" rules forbid this. To do so, you must digitally sign the applet. Alternatively, if the file in question is accessible from the HTTP server from which you downloaded the applet, you can use an HttpURLConnection to cause the HTTP server to pass you a copy of the data. If you wish to update it, you also have to write server-side code to accept the updated data (via a HttpURLConnection POST request) and do the writing.
An IDE is no substitute for an Intelligent Developer.
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads