You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Karthik Nanjangude <ka...@xius-bcgi.com> on 2009/03/19 10:27:31 UTC

tomcat - perl cgi

Hi

Declared  in  webapps/ PERL_TOOLS_SITE / WEB-INF/web.xml

for CGI Perl  execution as given below,

<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>WEB-INF/cgi</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


<!-- The mapping for the CGI Gateway servlet -->

<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping>
</web-app>



http://localhost:8080/PERL_TOOLS_SITE/cgi/hello.cgi

Unsuccessful   :  HTTP Status 404 - /PERL_TOOLS_SITE/cgi/hello.cgi

http://localhost:8080/PERL_TOOLS_SITE/cgi-bin/hello.cgi

Successful : How ?

Although the  "<servlet-name>cgi</servlet-name>"  is mapped in web.xml

Thanks & Regards
karthik



Re: tomcat - perl cgi

Posted by Thangavel Sankaranarayanan <ts...@in.ibm.com>.

Hi,


<servlet>
<servlet-name>cgi</servlet-name>               (----3-----)
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
(----4-----)
</servlet>

<servlet-mapping>
<servlet-name>cgi</servlet-name>        (----2-----)
<url-pattern>/cgi-bin/*</url-pattern>   (----1-----)
</servlet-mapping>

The Http servlet request's context path (/cgi-bin) is checked first in
servlet mapping(1) and if one found , tomcat obtains the name of the
servlet(2).
Using the name of the servlet (3) it find the name of the class to
execute(4)

http://localhost:8080/PERL_TOOLS_SITE/cgi/hello.cgi

Unsuccessful   :  HTTP Status 404 - /PERL_TOOLS_SITE/cgi/hello.cgi

>> no mapping available for cgi in servlet-mapping element

http://localhost:8080/PERL_TOOLS_SITE/cgi-bin/hello.cgi

Successful : How ?

>> maping available inside servlet-mppaing element

Thanks,
Thanga



                                                                           
             Karthik                                                       
             Nanjangude                                                    
             <karthik.nanjangu                                          To 
             de@xius-bcgi.com>         Tomcat Users List                   
                                       <us...@tomcat.apache.org>           
             19/03/09 02:57 PM                                          cc 
                                                                           
                                                                   Subject 
             Please respond to         tomcat - perl cgi                   
               "Tomcat Users                                               
                   List"                                                   
             <users@tomcat.apa                                             
                 che.org>                                                  
                                                                           
                                                                           




Hi

Declared  in  webapps/ PERL_TOOLS_SITE / WEB-INF/web.xml

for CGI Perl  execution as given below,

<servlet>
<servlet-name>cgi</servlet-name>
<servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
<init-param>
<param-name>debug</param-name>
<param-value>0</param-value>
</init-param>
<init-param>
<param-name>cgiPathPrefix</param-name>
<param-value>WEB-INF/cgi</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>


<!-- The mapping for the CGI Gateway servlet -->

<servlet-mapping>
<servlet-name>cgi</servlet-name>
<url-pattern>/cgi-bin/*</url-pattern>
</servlet-mapping>
</web-app>



http://localhost:8080/PERL_TOOLS_SITE/cgi/hello.cgi

Unsuccessful   :  HTTP Status 404 - /PERL_TOOLS_SITE/cgi/hello.cgi

http://localhost:8080/PERL_TOOLS_SITE/cgi-bin/hello.cgi

Successful : How ?

Although the  "<servlet-name>cgi</servlet-name>"  is mapped in web.xml

Thanks & Regards
karthik





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