Chapter 1. Writing Common Gateway Interface Programs

Overview of the CGI

.

.

1

Parsing

.

12

CGI and Dynamic Documents

.

. 2

Data manipulation

. 12

Uses for CGI

.

.

3

Response generation

.

12

The CGI process

.

.

3

Environment variables

.

13

Overview . . . . . . . . . . . . . . 3

Requests from Standard Search (ISINDEX)

 

 

Sending Information to the Server . . . .

.

.

5

Documents

.

15

Data Conversions on CGI Input and Output .

.

. 5

Passing SSL Environment Variables to a CGI

 

 

CGI Input Conversion Modes

.

.

6

Program

.

15

DBCS Considerations

.

. 7

CGI Programs and AS/400 Activation Groups . .

. 17

CGI Output Conversion Modes . . . .

.

. 9

AS/400 Activation Groups

. 17

Returning Output from the Server . . . .

.

.

11

CGI Considerations

.

18

How CGI Programs Work

.

. 12

Activation Group Problem Examples . . . .

. 18

This chapter discusses the Common Gateway Interface (CGI): What it is, why you might want to use it, and how it works.

Overview of the CGI

CGI is a standard, supported by almost all web servers, that defines how information is exchanged between a web server and an external program (CGI program).

The CGI specification dictates how CGI programs get their input and how they produce any output. CGI programs process data that is received from browser clients. For example, the client fills out a form and sends the information back to the server. Then the server runs the CGI program.

Programs that are called by the server must conform to the server CGI interface in order to run properly. We will describe this in further detail later in this chapter.

The administrator controls which CGI programs the system can run by using the server directives. The server recognizes a URL that contains a request for a CGI program, commonly called a CGI script. Depending on the server directives, the server calls that program on behalf of the client browser.

For more information on CGI, see this URL:

http://www.w3.org/Daemon/User/CGI/Overview.html.

AS/400® supports CGI programs that are written in C++, Rexx, Java®, ILE-C, ILE-RPG, and ILE-COBOL. It also supports multi-thread CGI programs in all of these languages capable of multiple threads. For sample code that can help you with CGI programs, see the AS/400 Web Builder’s Workshop. You can find it at the following URL:

http://www.as400.ibm.com/tstudio/workshop/webbuild.htm.

You need to compile programs that are written in programming languages. Compiled programs typically run faster than uncompiled programs. On the other hand, those programs that are written in scripting languages tend to be easier to write, maintain, and debug.

© Copyright IBM Corp. 1997, 2000

1

Page 11
Image 11
IBM AS/400E manual Writing Common Gateway Interface Programs, Overview of the CGI

AS/400E specifications

The IBM AS/400E, now more commonly known as IBM i, is a robust and versatile midrange server that has been designed to provide a comprehensive computing solution for businesses of all sizes. First introduced in the late 1980s, the AS/400 series has undergone multiple enhancements and rebranding, with the AS/400E being one of the notable iterations. This powerful platform is closely associated with IBM's commitment to reliability, scalability, and integrated business solutions.

One of the main features of the AS/400E is its highly integrated architecture that combines hardware and software into a cohesive system. This integration allows for seamless operations, reducing the complexity typically associated with managing disparate systems. The system is powered by IBM's proprietary OS/400 operating system, which has evolved into IBM i, featuring advanced capabilities like object-oriented programming, integrated database management, and security features that are essential for enterprise environments.

A key characteristic of the AS/400E is its robust database support, primarily through the use of DB2 for i. This integrated database management system enables efficient data handling and retrieval, facilitating real-time business analytics and reporting. Furthermore, the platform supports a variety of programming languages, including RPG, COBOL, and Java, making it flexible for developers who require diverse tools for application development.

The AS/400E is also known for its exceptional reliability and uptime, making it a preferred choice for critical business applications in industries such as finance, healthcare, and manufacturing. This reliability is backed by advanced error detection and correction mechanisms, as well as redundancy features that help prevent data loss and minimize downtime.

In terms of scalability, the AS/400E can effortlessly expand to accommodate growing business demands. Organizations can increase processing power by adding more resources without significant disruption. This scalability, combined with the system’s built-in virtualization capabilities, allows businesses to optimize resource usage and streamline operations.

Security is another defining feature of the AS/400E. The platform incorporates various layers of security measures, including user authentication, encryption, and comprehensive auditing capabilities, ensuring that sensitive business data is protected against unauthorized access.

Overall, the IBM AS/400E remains a powerful tool in the enterprise computing landscape, providing businesses with an integrated, reliable, and secure solution for their technological needs. Its enduring popularity is a testament to its capability to evolve with changing business requirements while maintaining its core attributes of high performance and stability.