Embedding HTML in the 5250 Data Stream
V3R1 / V3R6 Considerations
Browsers are context sensitive to the data stream that they receive. In particular, they
assume that all less than signs (<) are a start of an HTML keyword and will not display any
characters until it reaches the next greater than sign (>). This will cause display problems
for any AS/400 data stream that contains a < that is not an HTML keyword. Because of this,
Webulator/400 recognizes a subset of HTML keywords and will escape all < characters
(change the < to a different set of characters) that are not part of a recognized HTML keyword.
This has two sets of ramifications. First is all < characters that are not a part of a
recognized HTML keyword will be displayed properly on Webulator/400 screens. The second
is that it is possible to embed certain HTML keywords into the 5250 data stream
and have them be interpreted by the browser. This means that you can include such things as
images or links to other URLs inside your screens. Please note that the number of supported
HTML keywords is very limited.
The following HTML keywords will be passed to the browser intact:
- <A ... > - Start of hyperlink anchor
- </A> - End of hyperlink anchor
- <IMG ... > - Image hyperlink
Care should be taken before embedding HTML fields in your 5250 screens.
You should take into account the following constraints when designing screens that
will contain embedded HTML keywords.
- You may want to make output fields that will contain HTML keywords to
have a display attribute of
Nondisplay (DSPATR(ND)). If you do
not do this, users viewing the screen with an application other than Webulator/400 will
see the HTML keywords as text and not as embedded images or links.
- HTML keywords usually require a large number of characters. You may run into
problems fitting them on your screen.
- You may run into some spacing problems. There is sometimes little to no correlation
between the amount of space needed for the keyword and the amount of space
needed for the resulting image or link.
V3R2 and beyond
With the release of V3R2, IBM has introduced the HTML DDS keyword that will allow
AS/400 applications to embed any HTML tag into the 5250 data steam. This method
of embedding HTML offers the following advantages:
- HTML keywords do not occupy any screen space. You can add HTML anywhere on the
screen no matter how crowded it is.
- All HTML tags are supported.
- HTML keywords will not be passed to normal green screens or emulation programs.
One limitation imposed by IBM is that HTML keywords cannot be included in
subfile records.
Please refer to the following IBM publications for more information on the HTML DDS keyword.
- AS/400 DDS Reference - SC41-3712-01
- AS/400 Application Display Programming - SC41-3715-01