Find the answer to your Linux question:
Results 1 to 2 of 2
Hello I am having a little trouble placing a Java applet in a perl cgi web page (xttp://wisdom0/cgi-bin/test.pl - sorry I can't amke it live to the world. If I ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jul 2007
    Posts
    4

    [SOLVED] Running Java applet in cgi-bin


    Hello

    I am having a little trouble placing a Java applet in a perl cgi web page (xttp://wisdom0/cgi-bin/test.pl - sorry I can't amke it live to the world.

    If I use the following code I get no data and I get Java execution errors

    <applet code="MainAppApplet.class" archive="quickpcad.jar" name="myApplet" MAYSCRIPT>
    <PARAM name="file" value="100386.pca.txt"/>
    </applet>

    I know that by putting the jar in /var/www/html it will run, but I also get the following error

    <applet code="MainAppApplet.class" archive="../../quickpcad.jar" name="myApplet" MAYSCRIPT>
    <PARAM name="file" value="100386.pca.txt"/>
    </applet>

    (8)Exec format error: exec of '/var/www/cgi-bin/1100386.pca.txt' failed
    Premature end of script headers: 100386.pca.txt

    If I move the data I get no error, but also no data even though the file can be navigated to with a url (xttp://wisdom0/cgi-bin/../../100386.pca.txt)

    <applet code="MainAppApplet.class" archive="../../quickpcad.jar" name="myApplet" MAYSCRIPT>
    <PARAM name="file" value="../../100386.pca.txt"/>
    </applet>

    However, if I launch this very same code in a new window (window.open js function) it works fine.

    And if I try absolute URLs (ie. xttp://) it gives me cannot stat /var/www/html/http: errors.

    I presume this has something to do with not being able to running Java applets in Apache cgi-bin, but I can't find anything that tells me how to get the best of both worlds - a perl cgi page with a java applet embedded in it.

    Can anyone tell me where I am going wrong? Also, can someone confirm what happens when the window.open fn launches a new window - is it launching it as if it was xttp://wisdom0/ and not xttp://wisdom0/cgi-bin.

    Thanks

    Mark

    p.s. please excuse the xttp:// - it appears to be a restriction of the forum

  2. #2
    Just Joined!
    Join Date
    Jul 2007
    Posts
    4
    Problem solved - it was a file permissions problem

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •