This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Tomcat and the fly likes Java  & CGI Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
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: 60049
    
  65

Java as CGI? Why?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12675
    
    5
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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13869
    
  10

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://aspose.com/file-tools
 
subject: Java & CGI
 
Similar Threads
Java/Servelt with CGI
Connecting Java Application to Database using Cgi
file upload..urgent..
java vs html and other webdesigning
My (thin) Perl experience