Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

can an applet make a network connection to the host computer

 
ravi vardhin
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic