Providing a favorites icon

Many web browsers automatically make a request for a favorites icon (favicon) when a user visits or bookmarks a web page. You can provide a favicon as a static response using a URIMAP definition.

About this task

A favicon, also known as a website icon, shortcut icon, url icon, or bookmark icon is a 16×16 pixel, 32×32 pixel or 64×64 pixel square icon associated with a particular website or web page. A web designer can create a favicon and install it into a website or web page, and most graphical web browsers use the installed favicon.
Web browsers make requests for default favicons using the following URL:
http://www.example.com/favicon.ico
where www.example.com is the host name for the site. The HTTPS scheme can be used instead, if appropriate. You can provide a favicon in these ways:
  • A default favicon that is returned for any host name used by your CICS® region
  • A different default favicon for each host name used by your CICS region
If a web browser requests a favicon and you do not provide one, CICS sends an error response to the browser:
  • If you are using the CICS-supplied default analyzer DFHWBAAX, a 404 (Not Found) response is returned. No CICS message is issued in this situation.
  • If you are using the sample analyzer DFHWBADX, or a similar analyzer that can interpret only the URL format that was required before CICS TS Version 3, the analyzer might misinterpret the path favicon.ico as an incorrectly specified converter program name. In this case, message DFHWB0723 is issued, and a 400 (Bad Request) response is returned to the browser. To avoid this situation, you can either modify the analyzer program to recognize the favicon request and provide a more suitable error response, or provide a favicon using a URIMAP definition. Both actions mean that the sample analyzer program is bypassed for these requests.

To provide a favicon for all or some of your host names, using a URIMAP definition, follow these steps:

Procedure

  1. Create the favicon and store it in a suitable location on a z/OS® UNIX file system.
    1. You can create the favicon using an icon editor package, or use an icon converter program to convert an image created in another format.
    2. The favicon must be 16 by 16 pixels.
      Browsers might ignore favicons that are not the correct size.
    3. The favicon must be saved in Windows icon format (.ico file extension), and named favicon.ico.
    Most web servers store the favicon in the root directory for the host name. For CICS, a URIMAP definition can provide a favicon stored anywhere on z/OS UNIX. The CICS region must have permissions to access z/OS UNIX, and it must have permission to access the z/OS UNIX directory containing the file and the file itself. Giving CICS regions access to z/OS UNIX directories and files explains how to grant these permissions.
  2. Create a URIMAP definition using the CICS Explorer to provide the favicon as a static response, as described in
    The following sample URIMAP definition attributes provide a favicon for all host names used by the CICS region:
    Table 1. Example favicon values for a URIMAP definition
    Attribute Value Description
    URIMAP favicon The name of the URIMAP
    Group MYGROUP Any suitable group name
    Description Favicon  
    Status Enabled  
    Usage Server For CICS as an HTTP server
    Scheme HTTP Will also match HTTPS requests
    Host * * matches any host name. Specify host name if you provide different favicons.
    Path /favicon.ico Browsers use this path to request favicons
    TCPIPSERVICE   Blank matches any port
    Media type image/x-icon Choose a suitable media type
    zFS file /u/cts/CICSHome/favicon.ico Location of the favicon in zFS
    Note: Code page conversion is not required for a favicon, so do not specify the CHARACTERSET or HOSTCODEPAGE options.