java cgi lecture notes by theodoros anagnostopoulos
TRANSCRIPT
![Page 1: Java CGI Lecture notes by Theodoros Anagnostopoulos](https://reader036.vdocuments.us/reader036/viewer/2022083008/56649ea35503460f94ba7f71/html5/thumbnails/1.jpg)
Java CGI
Lecture notes by Theodoros Anagnostopoulos
![Page 2: Java CGI Lecture notes by Theodoros Anagnostopoulos](https://reader036.vdocuments.us/reader036/viewer/2022083008/56649ea35503460f94ba7f71/html5/thumbnails/2.jpg)
Java CGI
• Write CGI programs in Java.• Learn how to program the server side of your
Web applications through Java.
![Page 3: Java CGI Lecture notes by Theodoros Anagnostopoulos](https://reader036.vdocuments.us/reader036/viewer/2022083008/56649ea35503460f94ba7f71/html5/thumbnails/3.jpg)
Java CGI
• The Common Gateway Interface (CGI) is a standard for writing programs that can interact through a Web server with a client running a Web browser.
• These programs allow a Web developer to deliver dynamic information (usually in the form of HTML) via the browser.
![Page 4: Java CGI Lecture notes by Theodoros Anagnostopoulos](https://reader036.vdocuments.us/reader036/viewer/2022083008/56649ea35503460f94ba7f71/html5/thumbnails/4.jpg)
Java CGI
• A CGI program can be written in any language, including Java, that can be executed by your Web server.
• CGI programs are commonly used to add search engines, guest-book applications, database-query engines, interactive-user forums, and other interactive applications to Web sites.
![Page 5: Java CGI Lecture notes by Theodoros Anagnostopoulos](https://reader036.vdocuments.us/reader036/viewer/2022083008/56649ea35503460f94ba7f71/html5/thumbnails/5.jpg)
Java CGI
• In very basic terms, a CGI program must interpret the information sent to it, process the information in some way, and generate a response that will be sent back to the client.
• Most of the input to a CGI program is passed into it through environment variables.
• The rest of the input (if any) is passed into a CGI program as standard input that can be read directly by your program.
![Page 6: Java CGI Lecture notes by Theodoros Anagnostopoulos](https://reader036.vdocuments.us/reader036/viewer/2022083008/56649ea35503460f94ba7f71/html5/thumbnails/6.jpg)
Java CGI
• The processing can be as simple as appending information to a file or as complex as requesting data from a database.
![Page 7: Java CGI Lecture notes by Theodoros Anagnostopoulos](https://reader036.vdocuments.us/reader036/viewer/2022083008/56649ea35503460f94ba7f71/html5/thumbnails/7.jpg)
Java CGI
• Since a CGI program can return a myriad of document types, a CGI program must place a short header (ASCII text) on its output so that the client will know how to interpret the information it generates.
• Most commonly, CGI programs generate HTML.• Following the header, a CGI program simply
generates the body of the output in its native form.
![Page 8: Java CGI Lecture notes by Theodoros Anagnostopoulos](https://reader036.vdocuments.us/reader036/viewer/2022083008/56649ea35503460f94ba7f71/html5/thumbnails/8.jpg)
Java CGI
• Online Tutorial:– http://
www.javaworld.com/article/2076863/java-web-development/write-cgi-programs-in-java.html
• Video Tutorial:– http://www.youtube.com/watch?v=mPLYJ6SmyXo