• Post Reply Bookmark Topic Watch Topic
  • New Topic

Applets & Security  RSS feed

Neaman Shafiq
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...
maateen ashraf
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..
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!