Re: Applet do's and don'ts ..........

Marianne Mueller (mrm@eng.sun.com)
Mon, 17 Mar 1997 23:17:50 -0800

Date: Mon, 17 Mar 1997 23:17:50 -0800
Message-Id: <199703180717.XAA03636@puffin.eng.sun.com>
From: Marianne Mueller <mrm@eng.sun.com>
To: sonal@dbs.co.in
Subject: Re: Applet do's and don'ts ..........

Refer to http://java.sun.com/sfaq/ for more details and examples on
the sandbox.

Briefly,

Downloaded applets running in Netscape Navigator or Microsoft Internet
Explorer cannot read or write files on the client system.

The HotJava browser allows you to configure the files that can be
read/written locally, by downloaded applets, in the
$HOME/.hotjava/properties file.

Note --

If you install the applet in a directory of the CLASSPATH used by the
browser, then the applet is treated as though it's part of the trusted
local system, and it's allowed full access. So in that case, the
applet could read/write any files that your JVM could access,
according to whatever OS permissions you have set up.

The error messages you cite

>
> Applet can't start: <.class file name> got a security violation:
> method verification error
>
> java.lang.NoClassDefFoundError
>

don't sound like typical "security exceptions" but might refer to some
other Java programming bug. Try using the same method calls from a
standalone Java application (as a way to debug your code), or use the
appletviewer to debug your code. The appletviewer is a fast and
simple tool that is very helpful for debugging applets.

Sometimes it's hard to debug applets using a Java-enabled browser
since they don't necessarily support class unloading, and the only way
to do the modify-compile-debug-test cycle is to restart the browser
for every "test" part of the cycle.

Marianne