IceWalkers.com - Linux Software downloads and news
Name : Password :
Linux SoftwareLinux RPMLinux HowtosLink UsAboutAdvertise

Java CGI HOWTO

Search Howtos :Match :
Next Previous Contents

4. Executing a Java CGI Program

4.1 Obstacles to Running Java Programs Under the CGI Model

There are two main problems in running a Java program from a web server:

You can't run Java programs like ordinary executables.

You need to run the Java run-time interpreter and provide the initial class (program to run) on the command-line. With an HTML form, there is no provision for sending a command-line to the web server.

Java does not have general access to the environment.

Every environment variable that will be needed by the Java program must be explicitly passed in. There is no method similar to the C getenv() function.

4.2 Overcoming Problems in Running Java CGI Programs

To deal with these obstacles, I wrote a shell CGI program that provides the information needed by the Java interpreter.

The java.cgi script.

This shell script manages the interaction between the HTTP daemon and the Java CGI program that you wish to use. It extracts the name of the program that you want to run from the server-provided data. It collects all of the environment data into a temporary file. Then, it runs the Java run-time interpreter with the name of the file of environment information and the program name added to the command-line.

The java.cgi script was configured and installed in Decide On Your Local Path Policies.

Invoking java.cgi from an HTML form.

My forms that use Java CGI programs specify a form action as follows:

<form action="/cgi-bin/java.cgi/CGI_Test" method="POST">
Where /cgi-bin/ is your local CGI binary directory, java.cgi is the Java front-end that allows us to run Java programs over the web and CGI_Test is an example of the name of the Java program to run.


Next Previous Contents
Search Howtos :Match :
My Money 2.0.49
Personal financial software
Linux Kernel 2.6 2.6.32-rc8
Linux Kernel
GCstar 1.5.0
Personal collections manager
ImageMagick 6.5.7.9
ImageMagick image processing studio
BibleTime 2.4
Bible study software for Linux / KDE
PHP 5.3.1
Server-side, cross-platform, HTML embedded scripting language.
LFTP 4.0.4
Shell-like command line ftp client.
Tellico 2.1.1
Collection manager for books, music, videos, and bibliographies
Totem 2.28.4
Movie player for Gnome
GNOME 2.29.2
GNOME desktop environment
Free IT Magazines, White Papers, eBooks, and more !
Oracle Magazine

Contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more.

Vulnerability Management for Dummies

Get all the Facts and See How to Implement a Successful Vulnerability Management Program.

Website Magazine

Has tapped premier talent in the Internet industry for our content and each and every issue will contain practical advice and insights for website owners.

Linux Software Map
Find Linux RPM
Best Rated Linux Software
Most Rated Linux Software
Linux Distributions
Linux Howtos
Quick Survey

Please take our survey and help us improve our website to serve you better.

Thank you.
Linux Software
Linux / IT Resources
Site Resources
Google
Privacy Policy
Contact Us
Submit Software
Advertising info