aspose file tools
The moose likes Tomcat and the fly likes Java  & CGI Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Java  & CGI" Watch "Java  & CGI" New topic
Author

Java & CGI

victor kamat
Ranch Hand

Joined: Jan 10, 2007
Posts: 247
Can somebody guide me to material that will help me run a Java Program thru CGI.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 56529
    
  14

Java as CGI? Why?


[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12324
    
    1
Java servlets use the conventions of CGI - Common Gateway Interface just like all other web servers.

Do you have an existing Java program that must be executed through a request to a servlet? If not, why are you posting in the Tomcat forum?

Bill


Java Resources at www.wbrogden.com
Jesper de Jong
Java Cowboy
Bartender

Joined: Aug 16, 2005
Posts: 12952
    
    3

This forum is not only about Tomcat, you can also ask questions about Apache HTTP server here.

Running Java programs as CGI is not a good idea. It will be really slow, because each time the webserver needs to call your Java program, it has to start up a new JVM process (which is slow) to run your Java program.

You should really use servlets instead of trying to run Java programs via CGI.

If you have an Apache HTTP server running as your web server, then you could connect Tomcat to it and run your servlets in Tomcat.
[ December 12, 2007: Message edited by: Jesper Young ]

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Java & CGI
 
Similar Threads
file upload..urgent..
java vs html and other webdesigning
My (thin) Perl experience
Connecting Java Application to Database using Cgi
Java/Servelt with CGI