Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

embedding swing (java 1.4.1) applets using CGI.pm

by seaver (Pilgrim)
on Nov 25, 2002 at 22:14 UTC ( [id://215743]=perlquestion: print w/replies, xml ) Need Help??

seaver has asked for the wisdom of the Perl Monks concerning the following question:

Ok,this may entail a bit of java...

so I have an applet that takes a file and produces an image depending on the information contained in the file...

this information file is in turn produced by a perl script dubbed MONSTER(which in turns parses and feeds molecular data into another program and uses the output from that to produce the information file, but i digress)

previously, my java applet, was embedded in a JSP page, which took an information file, used a bean to upload it, and then passed it into the applet...

now I want to be able to direct the information file from MONSTER directly into the applet, or in other words, have a web interface to MONSTER, where I can run it from the browser, and then have a button that opens the applet and pass the resulting information file into the applet..

to this end, im using httpd from apache instead of Tomcat, and am trying to embed the applet using CGI.pm, but it's not working, has anyone had any experience with this? the applet is opening in the web browser, but is not initialising properly, it seems it can't find the class file...

i just want to know if this is possible, and the best way to do this, in the first place, i thought about running it via tomcat, but having a servlet run a perl script sounded like a long way round, i though cgi would be better, anyone?

thanks S

  • Comment on embedding swing (java 1.4.1) applets using CGI.pm

Replies are listed 'Best First'.
Re: embedding swing (java 1.4.1) applets using CGI.pm
by BrowserUk (Patriarch) on Nov 26, 2002 at 01:06 UTC

    Sounds more like an issue with your Java setup and/or apache configuration rather than a perl issue. Can you embed the applet in a static html page served via Apache successfully?

    If you got that to work first, then you reduce the possible causes of failure once you try to do it from within perl/CGI.pm.


    Okay you lot, get your wings on the left, halos on the right. It's one size fits all, and "No!", you can't have a different color.
    Pick up your cloud down the end and "Yes" if you get allocated a grey one they are a bit damp under foot, but someone has to get them.
    Get used to the wings fast cos its an 8 hour day...unless the Govenor calls for a cyclone or hurricane, in which case 16 hour shifts are mandatory.
    Just be grateful that you arrived just as the tornado season finished. Them buggers are real work.

Re: embedding swing (java 1.4.1) applets using CGI.pm
by Cybercosis (Monk) on Nov 26, 2002 at 01:22 UTC
    While I haven't done anything like this with swing, I have with AWT-using applets, but I don't think the difference matters. Check where in your path the .class files are, and their permissions. If either of those isn't just right, it'll croak. You'll also probably need... I think it's basecode or somesuch tags in the html you're outputting with CGI.

    ~Cybercosis

    nemo accipere quod non merere

      Cybercosis, do you have an example of the cgi code that did the applet? cheers S
      OK, the applet works fine in a static html page in apache, but NOT in cgi, the class file is IN cgi-bin, shoudl it be elsewhere? and it is executable... cheers
      #!/usr/local/perl -w use CGI qw/:standard/; print header; print start_html('Monster'); print '<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" w +idth="1000" height="700" codebase="http://java.sun.com/products/plugi +n/1.2.2/jinstall-1_2_2-win.cab#Version=1,2,2,0"> <param name="java_code" value="Graphica.class"> <param name="type" value="application/x-java-applet;version=1.4"> <param name="file" value=""> <COMMENT> <embed type="application/x-java-applet;version=1.4" width="1000" h +eight="700" pluginspage="http://java.sun.com/products/plugin/" java_c +ode="Graphica.class" file="" > <noembed> </COMMENT> </noembed></embed> </object>'; print end_html;

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://215743]
Approved by mandog
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-24 10:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found