You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by CouasPhilippe <pc...@infodev.fr> on 2002/08/23 11:45:53 UTC

CGI FORM entry empty with TOMCAT standalone

Hi,

I Need to integrate some current CGI with an new Java Application.
So i have installed CGI in Tomcat 4.0.4 standalone and i want not use Apache.
 
CGI is running BUT I CAN'T receive FORM DATA. ?
my variable $keywords is empty.

I have also tried it with an Apache Standalone and that is Ok.
I suppose some problem with  CGI ReadParse function.

Anyone have an idea ??

Thanks
Philippe



------------------------------------------------

HTML FILE


<form
        action="/cgi-bin/search.cgi" method="POST">
            <p align="center"><font color="#FFFF00"><b>Recherche</b></font></p>
            <p><font color="#FFFF00">Mot(s) Clef(s):</font> <br>
            <input type="text" size="19" maxlength="256"
            name="keywords"></p>
            <p><input type="checkbox" name="exact_match"><font
            color="#FFFF00">mots exacts</font></p>
            <p align="center"><input type="submit"
            value="Rechercher"> </p>
        </form>



CGI File

#!/usr/local/bin/perl -T           
###################################
############################################################           
                                                                       
                                                                       
#$| = 1; # Set output to flush directly (for troubleshooting)          
$lib = "."; # Default path for loading libraries                       
$maskhtml="/home/httpd/html/mask.html";                                
                                                                       
require "$lib/cgi-lib.pl";                                             
                                                                       
# Define Server specific variables                                     
require "$lib/search_define.pl";                                       
                                                                       
# The following outputs the CGI Header                                 
print &PrintHeader;                                                    
                                                                       
# Get the form variables                                               
&ReadParse;                                                            
                                                                       
$keywords = $in{'keywords'};  


if ($keywords eq "") {           
    &PrintNoKeywordHTML;         
    next;                        
} # End of if keywords                                                    




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: CGI FORM entry empty with TOMCAT standalone

Posted by Stephan Orme <st...@panna.org>.
See earlier postings on CGI's I don't think included CGI's work in Tomcat
Standalone. I haven't been able to confirm this. Here's my earlier post:

I'm using Tomcat 4.0.4 to serve dynamic and static pages. I can get includes
to work and I can get CGI's to work but I can't get included CGI's to work.
<you can pick your friends, you can pick your nose...>
Anyway, here's what works:

includes on .html pages:
<!--#include virtual="Shared/footer"-->

includes on .jsp pages:
<%@ include file="Shared/footer" %>

CGI that works:
http://localhost/PCW/cgi-bin/test-cgi

And here's what DOESN'T work (this is on a .html page)
<!--#include virtual="/cgi-bin/test-cgi"-->
<!--#include virtual="/PCW/cgi-bin/test-cgi"-->
<!--#include virtual="../../WEB-INF/cgi/test-cgi"-->

My Tomcat config file is completely standard - I uncommented the SSI and CGI
bits and renamed the appropriate .jar files but there are no other config
changes. Since both CGI's and includes work my assumption here is that the
SSI servlet doesn't call the CGI servlet. In other words when I call the CGI
from the URL it gets handled by the CGI servlet, and when I include it it
gets handled by the SSI servlet but what I need is for the SSI servlet to
call the CGI servlet which it doesn't do.

Or I could just be making all this up. Anyone want to set me straight? Or,
even better, just tell me how to make it work. I've a lot of trouble using
Tomcat with Apache so I'd prefer to avoid that route and go with a straight
Tomcat solution if at all possible.  TIA, steve



> Hi,
> 
> I Need to integrate some current CGI with an new Java Application.
> So i have installed CGI in Tomcat 4.0.4 standalone and i want not use Apache.
> 
> CGI is running BUT I CAN'T receive FORM DATA. ?
> my variable $keywords is empty.
> 
> I have also tried it with an Apache Standalone and that is Ok.
> I suppose some problem with  CGI ReadParse function.
> 
> Anyone have an idea ??
> 
> Thanks
> Philippe
> 
> 
> 
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>