JANUS WEB TYPE

From m204wiki
Revision as of 20:04, 2 March 2011 by Admin (talk | contribs) (1 revision)
Jump to navigation Jump to search

<section begin="desc" />WEB TYPE<section end="desc" />


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

Syntax

<section begin="syntax" /> JANUS WEB portname TYPE [method] url mime_type <section end="syntax" />

JANUS WEB TYPE command syntax


Portname, method, and url are all explained in 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_ProcSend 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/html.
  • 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&CSQ. or &OSQ..HTML&CSQ. is assumed to produce output with a mime type of
    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 &OSQ..GIF&CSQ. 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 &OSQ..JPG&CSQ. or &OSQ..JPEG&CSQ. 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&TRADEMARK..
    application/x-java Binary data that contains Java object code that is to be executed in the browser's Java virtual machine.


    References

    See: List of Janus commands and List of JANUS WEB subcommands