• 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Applets & Security

Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am trying to create an applet which accepts user input from the user and then creates a new html file at the server side and then writes the user's input to that file. this seems to work fine as an ordinary application. but im experiencing difficulties with the applet version.
iv heard that this is due to the fact that the user cannot create and write to a file on the system the applet is running on for security reasons. can anyone suggest how i can get round this or am i buggered?
the following applet code is causing the trouble:
text=inputField.getText()//just grabbing the text user enterd
writer=new FileWriter("test.html");
StringTokenizer tokens;
tokens=new StringTokenizer(text);
//load the URL we want to display
url=new URL("file:/c:/work/project/parser/applet/test.html");
//create a HTML viewer to display the url
htmlOutputPane=new JEditorPane(url);
scrollPane=new JScrollPane();
catch(MalformedURLException err)
{ //etc etc...
Ranch Hand
Posts: 122
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
u cann't write to the server side in any file or even cannt
create any new file
cuz of the security restrictions of the browser on client side
so u have to either
let ur applet signed
set ur own security policy for the browser but this cant work cuz every browser has its own security policy which is set by manufacture of the VM
so the only way is to make ur applet signed
let me know what type of exceptions & errors r u getting
elaborate ur requirment
so as i can tell u some other solution..
Yup, yup, yup. Tiny ad:
Thread Boost feature
    Bookmark Topic Watch Topic
  • New Topic