Generating Output

Your CGI program can generate many types of output, including–but not limited to–HTML, WML, and XML. By default, it returns HTML output for users accessing your program on a Web site. If you want the output to be in XML format, or if you intend for it to be displayed on a WAP device, you must configure your program to generate XML or WML output instead. To do so, you use the runtime configuration variable, CGI_CONTENT_TYPE. (SeeCGI_CONTENT_TYPE for more information on this variable.)

Regardless of the format, to generate output, your CGI program must use the DISPLAY statement. With ACUCOBOL-GT, the DISPLAY verb constructs HTTP response headers for you automatically and routes them to "stdout". The response header that the DISPLAY verb generates can include a pointer to a URL where response data can be found, or it can be followed by an HTML, WML, or XML document. Headers that point to URLs have the content type "location". Headers that include form data have the content type "text/html", "text/wml", or "text/xml".

Note that the runtime can DISPLAY virtually any type of content, as long as the content type ID corresponds to the form specified in the DISPLAY syntax.