Why the hell only signed applets?

**** you sun!

I have just spent two hours writing this wonderful little "shell emulator" applet , intendet to take a simple command line class and execute it within an applet, displaying all the results of System.out on the screen and redirecting an input field as System.in.

Of course I want it to be flexible, so I load the "executed" class dynamicaly and invoke main() with reflections.

But some smartass at sun has decided that an applet should not be allowed to redirect System streams (as it would hurt anybody that I redirect System.out, noone is looking at the console anyway). I can get around this, but only by packing my applet in a jar file and signing it.

But then I can't load classes in the standart codebase anymore! This takes all the beautiful flexibility out of my work! I will either have to rewrite all those little example programms that my applet is supposed to execute to redirect System.out calls to a writer I control, or create a jar file for each one of those classes!

Security is good, but give the user some choice!

[1090 byte] By [hinterwaeldler] at [2007-9-30 11:35:09]
# 1
System.out should only be used for debug'n.why not create a status panel, and anywhere you System.out do a jtextArea.append("text");?
wew64 at 2007-7-4 12:36:21 > top of Java-index,Security,Signed Applets...
# 2

The target classes are exercise from a java curse for beginners. Most exercise are about as complex as

for (int i = 0; i < 10; i++) {

System.out.println(i);

}

All exercises use System.out as a mean to communicate with the user, and I don't really want to rewrite all those exercises.

The description of the exercises is given in an html file, and I think it would be nice to show the students in an applet how the exercise should behave once finished.

hinterwaeldler at 2007-7-4 12:36:21 > top of Java-index,Security,Signed Applets...
# 3

Well, I took the second approach and switched to different streams. It should be quite easy to replace all calls to System.out with ShellApplet.out, so I hope it will not cause too much work.

P.S: If anyone is interested in the applet, the current version is located at:

http://www.eyerit.ch/epfl/shell/test.html

Regards

Der Hinterwaeldler

hinterwaeldler at 2007-7-4 12:36:21 > top of Java-index,Security,Signed Applets...