tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mead, Jennifer L - VSCM" <Mead.Jenni...@vectorscm.com>
Subject RE: Simple question, but can't figure out answer
Date Tue, 11 Jul 2006 22:29:16 GMT
Ok, it is something with my unix environment because I just pointed my
code to the same gif on my windows box and up it comes!  All code is
fine, which I suspected because I have tried so many variations of it
something had to work.  Not sure what it could be but maybe I actually
don't know where my image directory is.  Even though I am giving it a
fully qualified path, there must be a default image directory somewhere?
Not sure.

Jen 

-----Original Message-----
From: Mead, Jennifer L - VSCM [mailto:Mead.Jennifer@vectorscm.com] 
Sent: Tuesday, July 11, 2006 2:53 PM
To: Tomcat Users List
Subject: RE: Simple question, but can't figure out answer

Oh yes tomcat works for any language CGI, you need to go into the conf
files and uncomment a few things but it works.  Not recommended because
it bypasses the security built into tomcat.

Here is a sample code with the img tag inserted:

#!/usr/local/bin/perl -w
#
########################################################################
####
#
# script:    ot_main.pl - main entry page into ICC outage tracker tool
#
# purpose:   a cgi script that calls pages that insert, display and
update
#            outage tracker records for ICC
#
# links:     ot_entry_form.pl - page to enter outage records
#            ot_view_all.pl -   page to view all outage records in
database
#
########################################################################
####
#

use warnings;
use CGI qw/:standard/;
use CGI::Carp qw( fatalsToBrowser );

$|=1 ;

$q = new CGI;
print $q->header("text/html"),
      $q->start_html("ICC Outage Tracker CGI Tool "); print
$q->h1=>("ICC Outage Tracker CGI Tool "),
      $q->h2,
      $q->hr,
      $q->img({-src=>'icc-logo.gif'}),
      $q->p,
      end_html;
      print "<a href=\"ot_entry_form.pl\">";
      print "Enter a New Outage Incident";
      print p;
      print "<a href=\"ot_view_all.pl\">";
      print "View Recorded Outage Incidents";
      print p;


What this does is draw the box where the image should be.  When I right
click on it and look at the properties and it finds the right file.
Just thought someone else would have ran into this ....

Jen

-----Original Message-----
From: Andrew Miehs [mailto:andrew@2sheds.de]
Sent: Tuesday, July 11, 2006 2:27 PM
To: Tomcat Users List
Subject: Re: Simple question, but can't figure out answer

Hi Jennifer,

Very strange! Tomcat and perl cgi! cool - didn't know it worked...

Are you sure you are not using Apache with mod_jk, or mod_proxy?

As for the perl..... Where is the page that prints the HTML?

why don't you just add

	print '<img src="'.$IMAGE_DIRECTORY.$image.'">';

Very confused....

Or could it be that you are using the wrong document root?

does http://myservername/images/icc-logo.gif deliver the correct image?

Andrew.


>> #!/usr/local/bin/perl -w
>>
>> #
>> #
>>
>> use warnings;
>> use CGI qw/:standard/;
>> use CGI::Carp qw( fatalsToBrowser );
>>
>> use constant BUFFER_SIZE => 4_096;
>> use constant IMAGE_DIRECTORY => "/images";
>>
>> $|=1 ;
>>
>> $q = new CGI;
>> print $q->header( -type => "image/gif" ); binmode STDOUT; my $buff = 
>> ""; my $image = "icc-logo.gif";
>>
>> local *IMAGE;
>> open IMAGE, IMAGE_DIRECTORY . "/$image" or die "cannot open file
>> $image:
>> $!";
>> while ( read( IMAGE, $buff, BUFFER_SIZE ) ) {
>>    print $buff;
>> } close IMAGE;



---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe,
e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message