Quantcast

tomcat - perl cgi

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

tomcat - perl cgi

Karthik Nanjangude
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


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: tomcat - perl cgi

Thangavel Sankaranarayanan


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
             [hidden email]>         Tomcat Users List                  
                                       <[hidden email]>          
             19/03/09 02:57 PM                                          cc
                                                                           
                                                                   Subject
             Please respond to         tomcat - perl cgi                  
               "Tomcat Users                                              
                   List"                                                  
             <[hidden email]                                            
                 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: [hidden email]
For additional commands, e-mail: [hidden email]

Loading...