JANUS WEB TYPE

From m204wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Assign mime-type to page suffix

The JANUS WEB TYPE command indicates the mime type of the output produced by the specified URL (url value).

Syntax

JANUS WEB portname TYPE [method] url mime_type

portname, method, and url are all explained under the JANUS WEB command.

mime_type is the mime type sent to the requesting browser. It should consist of two parts: the primary type and the subtype. The primary type and subtype should be separated by a forward slash (/).

No checking is made for a valid mime type as there is no exhaustive list of all valid mime types. In fact, new mime types can be invented for applications as deemed necessary. A browser can even be made to launch local applications by specifying your own mime type, in the form application/myapp where myapp is a locally specified token that will have to be manually associated with the application on each client machine.

Other than being sent verbatim to the browser, the primary mime type (the part before the slash) is used by Janus Web Server to determine whether EBCDIC-to-ASCII translation is to take place. If the primary mime type is text, output data will be translated from EBCDIC to ASCII, unless explicitly overridden by a BINARY, TEXT, or BASE64 format parameter on a JANUS WEB ON rule or in a $Web_Proc_Send function. Data that is sent to the browser via the "terminal" — for example, Print statements or error messages — is always translated from EBCDIC to ASCII, regardless of the output mime type.

The following are some of the standard and more common mime types used in web applications:

text/plain Text that is displayed at the browser in a monospace typeface, like Courier. Display of text/plain data on a browser also retains line breaks and blanks used for alignment. As such, text/plain is a useful mime type for representing output from Model 204 commands and legacy applications that use Print statements.

By default, any URL that does not end in one of the standard suffixes (HTM, HTML, GIF, JPG, JPEG) is assumed to be text/plain.

text/html Text that contains HTML markup tags. Most formatted text in web applications is sent as text/html. By default, any URL ending in ".HTM" or ".HTML" is assumed to produce output with a mime type of text/html.
text/xml Readable text with markup which parses as an XML document.
image/gif Binary data conforming to the Compuserve GIF image format. This is one of the most popular formats for storing graphical images. By default, any URL ending in ".GIF" is assumed to produce output with a mime type of image/gif.
image/jpeg Binary data conforming to the JPEG image standard. This is one of the most popular formats for storing graphical images. By default, any URL ending in ".JPG" or ".JPEG" is assumed to produce output with a mime type of image/jpeg.
application/pdf Binary data that is intended to be read by the Adobe Acrobat Reader™.
application/x-java Binary data that contains Java object code that is to be executed in the browser's Java virtual machine.

See also