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

Around the sandbox...

 
Mark Owens
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I would like to write a trivia applet for my web page. I think I can do this well enough, but I want it to be able to keep track of scores. Thus it would have to write to a file (or something).
Is there a way to get around the restrictions (sandbox) to do this?
If the applet were written as a servlet, could the applet write a text file to the server? My machine is also the webserver so this would get me where I want to go...
All help appreciated...
Mark
 
paul wheaton
Trailboss
Pie
Posts: 21893
Firefox Browser IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Applets can talk to the machine it was loaded from with no problems.
If you want your applet to talk to the machine it is running on, you'll have to sign your applet and that can be a big pain in the butt.
 
Mark Owens
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. Just to make sure I have this straight: for the applet to read/write to the client machine would definitely be "outside the box" but to write back to the server would be ok. If this is true all I need to do is create a file object with the URL of the server and use randomAccessFile to write to it (OK, maybe I should reread the I/O chapter first...).
Thanks a ton!
Mark
 
Tony Alicea
Desperado
Sheriff
Posts: 3226
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The File class cannot represent a URL and the RandomAcessFile is for disk files. Yes, reviewing the chapter on I/O would help
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic