a elmas wrote:Hi,
The applet I've written has two tasks, both are called in the same class file, AppletRunner.class.(I have a single running applet).
One is doing one line calculation with inputs and showing the result in a message box, just like a calculator.
The other involves file writing and unix exec. It writes two of the TextField inputs into files, "file1.txt", "file2.txt".
Then, this file is executed by a perl code, such as,
("some_perl_code.pl" is in the same folder with other classes.)
With Eclipse, the applet is running and executing both tasks with no problems.
The problem is when I upload it to a web page, www.thepagename.com/MyApplet/classes/,
first task still works but the task involving the file writing and unix command does not work.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Ulf Dittmer wrote:Fine-tuning the policy file is tricky business. Why don't you just sign the applet (and possibly run the critical code sections as privileged code)? See HowCanAnAppletReadFilesOnTheLocalFileSystem for details.
James Sabre wrote: Since the Applet runs on the client then your Perl script must run on the client and based on your code you need to have place it in the directory on the client pointed to by the content of the String 'current_directory' . How do you get hold of that directory on the client and how do you copy the Perl script to that directory?
a elmas wrote:
Dear Sabre,
The current_directory gets the path where the class files and perl script are:
I assume below line returns,
current_directory = "http://www.abcd.edu/~xyzt/MyApplet/classes/packet_path/"
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
James Sabre wrote: Even if it is a URL it does not allow Runtime.exec() to execute on the Client a Perl script located on the Server.
a elmas wrote:
James Sabre wrote: Even if it is a URL it does not allow Runtime.exec() to execute on the Client a Perl script located on the Server.
I absolutely need to execute these scripts from the server. Otherwise, if these perl scripts and c binary files for sure need to be copied to the client's computer in order to be executed then writing the web applet is nonsense and I will just distribute the jar package.
Beyond the web deployment, I tried the applet in my local folder and it has the same issue, I could not figure out yet.
When running AppletRunner.java in Eclipse the applet runs and there is no problem; however, starting it from the html file -that is in the same folder with classes folder- it runs but that second task gives error.
Any idea about this issue?
Thanks.
html file consists of:
----
Eclipse IDE for Java Developers.
MacOSX 10.6.7.
Retired horse trader.
Note: double-underline links may be advertisements automatically added by this site and are probably not endorsed by me.
Don't get me started about those stupid light bulbs. |