File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Tomcat and the fly likes CGI and Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "CGI and Tomcat" Watch "CGI and Tomcat" New topic

CGI and Tomcat

Kevin Wright
Ranch Hand

Joined: Jul 10, 2001
Posts: 38
I have a Tomcat web server, and since my application is fairly small, I would like to serve web pages from it as opposed to the Apache HTTP server. The only problem is, I need to run CGIs - is there a way to do this in Tomcat?
Thomas Paul
mister krabs
Ranch Hand

Joined: May 05, 2000
Posts: 13974
Did some quick reserach on the mailing lists and it appears the answer is no.

Associate Instructor - Hofstra University
Amazon Top 750 reviewer - Blog - Unresolved References - Book Review Blog
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

I did a slightly less quick search.

The answer is a tentative yes, seeing as how I've never done it myself... but look in the CATALINA_HOME\conf\web.xml file, around line 190 you'll see a huge block commented out:
<!-- Common Gateway Includes (CGI) processing servlet, which supports -->
<!-- execution of external applications that conform to the CGI spec -->
<!-- requirements. Typically, this servlet is mapped to the URL pattern -->
<!-- "/cgi-bin/*", which means that any CGI applications that are -->
<!-- executed must be present within the web application. This servlet -->
<!-- supports the following initialization parameters (default values -->
<!-- are in square brackets): -->
I also searched through my few-month archive on the Tomcat-Users list, but hadn't found any references to this ability. So it's probably untried and not popular. After all, JSP/Servlets are supposed to replace all that Perl/C/C++ cgi stuff, right?
I agree. Here's the link:
subject: CGI and Tomcat
It's not a secret anymore!