• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

can an applet make a network connection to the host computer

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic