httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brent 'Dax' Royal-Gordon <br...@brentdax.com>
Subject Re: [users@httpd] Can't find java applet class via Perl/CGI
Date Sat, 15 May 2004 07:20:07 GMT
小野塚 昭 wrote:
> My trouble is that web server can't find java applet class location via 
> Perl/CGI.Could anybody give me some solution or comments? I attach 
> relating perl scripts and source java code and httpd.conf.
> Thank you.

Does this work if you access Param.html directly?  Does it work if you
remove or comment out the <param> line?  Are there any specific error
messages you see?

> Param.pl start####################################
> #!/usr/local/bin/perl
> use CGI::Cookie;
> use CGI qw/:standard :html3/;
> use CGI::Carp qw/fatalsToBrowser/;
> my($cgi)    = new CGI;
> print ($cgi->header);
> my $html="Param.html";
> open(IN,"<$html");
> while(<IN>){
>     print "$_<BR>";
> }
> close IN;
> Param.pl End#########################################

This looks like a fairly useless script.  I assume that you're actually
using a more complicated script, but you've reduced it to this as a test
case?  If so, I commend you for helping us help you.

The only thing that sticks out here is that you haven't used the $|
special variable, which ensures that calls to 'print' output the
information immediately.  I recommend putting a line like '$|=1;' near
the beginning of the program.  This probably won't fix your problem in
this case, but it's a good habit.

(I could also make a stylistic point or two, but this is an Apache list,
not a Perl list...)

> Param.html Start####################################
> <html>
> <body>
> <center>
> <applet archive="Param.jar" code="Param.class" Width="300" Height="100">
> <param name="message" value="You can get a parameter from HTML");

The line above looks incorrect--it seems to me that you should have a
'>' at the end of the line instead of ');'.  Is this a mistake made when
you were copying the code to this e-mail, or is the actual code like this?

> httpd.conf <- skipping comments
> Start##########################

> <Files ~ "^\.ht">

(Note for Western readers who aren't familiar with Japanese encodings:
Many of the Japanese character sets use the yen sign in place of
backslash.  They also use an overline instead of tilde.  Thus, this
user's config files may look a little weird...[1])

> TypesConfig "/etc/mime.types"

This probably isn't the problem, but just to be safe, can you run the
following command at a shell prompt?

    grep 'java' /etc/mime.types

On my server, I get:

    brent@navi/~$ grep 'java' /etc/mime.types
    application/x-java-applet
    application/x-java-archive                      jar
    application/x-java-bean
    application/x-java-jnlp-file                    jnlp
    application/x-java-serialized-object            ser
    application/x-java-vm                           class
    application/x-javascript                        js
    text/x-java                                     java

The important line is the x-java-archive one.

> AddDefaultCharset ISO-8859-1

Unrelated note: you might want to tweak this setting if you serve a lot
of content in Japanese off this server.  As it is now, your server is
telling clients that the content leaving it is in Latin-1.[2]

Most likely none of this will fix your problem, but perhaps I've
stumbled across a solution.

Hope this helps,
-- 
Brent "Dax" Royal-Gordon <brent@brentdax.com>
Perl and Parrot hacker

Oceania has always been at war with Eastasia.


[1] I know an essentially useless amount of Japanese, which is why I
have Japanese fonts installed.

[2] You may already know this, and set it to Latin-1 just to rule out
the character set being an issue.  You may also have a good reason to
set the charset to Latin-1.  I'm telling you this just in case that
isn't true.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message