java & CGI  
Author Message
Nancy.Nicole





PostPosted: 2006-3-6 12:59:00 Top

java-programmer, java & CGI I am a programming student attempting a quoting system (similar to what
geico does) for my job. I've written a program that is executable from
the command prompt that returns the expected values, but I need it to
work with a webpage.

I want the user to be able to input data, the program process it, and
then display the results. I've found code that uses "POST" to get the
data to a program, but how does the program process it and how do I get
it back into another web page? I've searched the web but I'm having
difficulty finding answers.

Thanks in advance to anyone who can help.

 
James McGill





PostPosted: 2006-3-6 13:07:00 Top

java-programmer >> java & CGI On Sun, 2006-03-05 at 20:59 -0800, email***@***.com wrote:
> I am a programming student attempting a quoting system (similar to what
> geico does) for my job. I've written a program that is executable from
> the command prompt that returns the expected values, but I need it to
> work with a webpage.
>
> I want the user to be able to input data, the program process it, and
> then display the results. I've found code that uses "POST" to get the
> data to a program, but how does the program process it and how do I get
> it back into another web page? I've searched the web but I'm having
> difficulty finding answers.
>
> Thanks in advance to anyone who can help.
>

The very last thing you want to do for this kind of situation is "CGI".

You would be much better off using a Servlet container, and writing to
that framework.

Get and install a copy of Tomcat.

Stop designing in a "command line" frame, and start over, designing a
"web service" (extend HTTPServlet).

Without having to code it, your service() routine gets a a Request and a
Response object. Your input from the client (and other useful info) is
in the Request, and the output back across the web is built in the
Response.

Tomcat might not be the best Servlet engine for a production system, but
it will certainly get you started, comes with good examples, is free,
etc.)

There are even more sophisticated ways of solving this kind of problem,
but don't go there just yet.

 
Hal Rosser





PostPosted: 2006-3-7 8:48:00 Top

java-programmer >> java & CGI
<email***@***.com> wrote in message
news:email***@***.com...
> I am a programming student attempting a quoting system (similar to what
> geico does) for my job. I've written a program that is executable from
> the command prompt that returns the expected values, but I need it to
> work with a webpage.
>
> I want the user to be able to input data, the program process it, and
> then display the results. I've found code that uses "POST" to get the
> data to a program, but how does the program process it and how do I get
> it back into another web page? I've searched the web but I'm having
> difficulty finding answers.
>
> Thanks in advance to anyone who can help.
>
You should get this book - it will guide you for your first steps into web
programming with java.
The keywords are "JSP" ( Java Server Pages) , Servlets, and the Tomcat
server /container.
Assuming you already know java.


 
 
Hal Rosser





PostPosted: 2006-3-7 8:49:00 Top

java-programmer >> java & CGI
<email***@***.com> wrote in message
news:email***@***.com...
> I am a programming student attempting a quoting system (similar to what
> geico does) for my job. I've written a program that is executable from
> the command prompt that returns the expected values, but I need it to
> work with a webpage.
>
> I want the user to be able to input data, the program process it, and
> then display the results. I've found code that uses "POST" to get the
> data to a program, but how does the program process it and how do I get
> it back into another web page? I've searched the web but I'm having
> difficulty finding answers.
>
> Thanks in advance to anyone who can help.
>
oops - the book is here
http://www.murach.com/books/jsps/index.htm

forgot to include it


 
 
Nancy.Nicole@gmail.com





PostPosted: 2006-3-9 13:22:00 Top

java-programmer >> java & CGI Thanks guys!