• 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

Writing to a server from an applet

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am trying to create a html page based on data I obtain from an applet, and store this page on the server, where the applet is running from. It works when I test it locally on my own machine, but when I try it live, online, it dosnt seem to create the page.

The (edited) code I use to create the page is as follows:


The execution of the code dosnt seem to go into the try. It just stops there.
I set all the permissions on the folders required to #777
Perhaps its not possible to use a buffered writer in this manner?
Ive been trying a few things with URI references instead of file objects but Im not having much luck there.

Any help greatly appreciated.
Thank you,

Eoin.
[ July 04, 2007: Message edited by: Eoin Mac Aoidh ]
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

catch(IOException ioexception) { }


Empty catch blocks are rarely a good idea, and definitely not with an IOException. How will you know what's going wrong?

Since the applet is attempting file I/O, it needs to be signed, or the local security policy altered. Is that the case? (Details about both are at HowCanAnAppletReadFilesOnTheLocalFileSystem).
 
Eoin Mac Aoidh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ulf,
I dont think its a security problem, the applet is signed. It seems to be something else.
Thamks for the I/O exception tip. - Ill work on that. I just threw the try/catch clause together quickly for the sake of creating a coherent post.

Eoin
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just noticed you're trying to construct the file name from "AppletCodebase" - if that's what the getCodeBase method returns, it can't possibly work, because if run on a web server it would be an HTTP URL (and there'd definitely be an IOException thrown).

Oh, and any file the applet writes would of course be created on the client, not on the server.
[ July 04, 2007: Message edited by: Ulf Dittmer ]
 
Eoin Mac Aoidh
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks again Ulf.
I was trying to use the getCodeBase method, running on a webserver and I was also trying to create the file on the server, not the client but I guess thats just not possible...
Ive worked around it though and created a file on the client. Its not quite what I wanted, but it will do! thanks for your pointers.

Eoin.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic