Article View: borland.public.jbuilder.java.language
Article #15465Re: PROBLEMS WITH writeObject
From: Charles Kilbride
Date: Tue, 15 Jun 1999 00:00
Date: Tue, 15 Jun 1999 00:00
59 lines
3109 bytes
3109 bytes
Greetings,
Applet security restrictions do not allow writing to disk files.
(Sorry!)
Yes, there are ways around it. In my opinion, they are not very
practical for large-scale deployment.
Hope this helps.
Regards,
Charles Kilbride | Sun Certified Java Programmer
Consulting Principal | Veteran C++ programmer (10 years)
Calderon Corporation | Certified PowerBuilder Developer (Professional)
| Certified SYBASE DBA
Phone: (312)986-8970 | and
FAX: (312)435-0208 | general-purpose architect/analyst/developer.
E-mail: cnk@calderoncorp.com
---
MJR wrote:
>
> Can anyone tell me why the following simple applet produces a
> com.ms.security.SecurityException... every time it is brought up?
>
> import java.awt.*;
> import java.applet.*;
> import java.io.*;
>
> public class Test extends Applet {
>
> public void init() {
> try {
> FileOutputStream out = new FileOutputStream( "testing.dat" );
> ObjectOutputStream oos = new ObjectOutputStream( out );
> oos.writeObject( "testing" );
> oos.flush();
> oos.close();
> FileInputStream in = new FileInputStream( "testing.dat" );
> ObjectInputStream inStream = new ObjectInputStream( in );
> String t = (String) inStream.readObject();
> inStream.close();
> Panel p = new Panel();
> p.add( new Label( t ) );
> add( "Center", p );
> setSize( 400, 100 );
> setVisible( true );
> }
> catch (Exception e) {
> System.err.println(e);
> System.exit(1);
> }
> }
>
> }
Technical Details
Message-ID:
<3765E826.D129AC04@calderoncorp.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7k3s2m$g7b$1@mailint03.im.hou.compaq.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d6b,4ad6f7ebbc681875 X-Google-Attributes: gid111d6b,public X-Google-Thread: f5d71,4ad6f7ebbc681875 X-Google-Attributes: gidf5d71,public X-Google-Thread: 10a146,4ad6f7ebbc681875 X-Google-Attributes: gid10a146,public X-Google-Thread: 113ae9,4ad6f7ebbc681875 X-Google-Attributes: gid113ae9,public X-Google-Thread: fecd1,4ad6f7ebbc681875 X-Google-Attributes: gidfecd1,public X-Google-Thread: f74b3,4ad6f7ebbc681875 X-Google-Attributes: gidf74b3,public X-Google-Thread: 10bb9b,4ad6f7ebbc681875 X-Google-Attributes: gid10bb9b,public X-Google-Thread: 115d3b,4ad6f7ebbc681875 X-Google-Attributes: gid115d3b,public From: Charles Kilbride <cnk@calderoncorp.com> Subject: Re: PROBLEMS WITH writeObject Date: 1999/06/15 Message-ID: <3765E826.D129AC04@calderoncorp.com> X-Deja-AN: 489730166 Content-Transfer-Encoding: 7bit References: <7k3s2m$g7b$1@mailint03.im.hou.compaq.com> To: MJR <Rao.Mohith@compaq.com> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Calderon Corporation Mime-Version: 1.0 Newsgroups: borland.public.jbuilder.java.language,comp.lang.java,comp.lang.java.api,comp.lang.java.help,comp.lang.java.machine,comp.lang.java.misc,comp.lang.java.programmer,comp.lang.java.security,microsoft.public.inetexplorer.ie4.java_applets,microsoft.publ