hi 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 try { writer=new FileWriter("test.html"); StringTokenizer tokens; tokens=new StringTokenizer(text); while(tokens.hasMoreTokens()) { System.out.println(tokens); writer.write(tokens.nextToken()+"\n"); } writer.close(); //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); htmlOutputPane.setEditable(false); scrollPane=new JScrollPane(); scrollPane.getViewport().add(htmlOutputPane); add("South",scrollPane); } catch(MalformedURLException err) { //etc etc...
maateen ashraf
Ranch Hand
Joined: Jan 08, 2001
Posts: 122
posted
0
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 or 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 or elaborate ur requirment so as i can tell u some other solution..