Content Aware Server Responses

WebSEAL supports the ability to use different response template pages for different content types. It also provides the ability to specify custom HTTP response codes for different generated responses. The content type and response code for a template file is determined by the name of the file itself. The MIME sub-type is defined by the file extension and the custom response code (if required) is embedded within the file name. The format of the file name is as follows:

<file identifier>{.<response_code>}.<mime sub-type>

The following table includes example file names:

Filename Description
login.html This file is returned for requests with the 'HTML' MIME sub-type. For example, text/html. The default login response code is used.
login.json This file is returned for requests with the ‘json’ MIME sub-type. For example, application/json. The default login response code is used.
login.401.json This file is returned for requests with the ‘json’ MIME sub-type. For example, application/json. The 401 HTTP response code is returned.

WebSEAL determines the correct file to use when generating a response by one of the following scenarios:

Once the correct content type is determined, WebSEAL searches for a matching file in the appropriate directory, as determined by the locale and junction. See Junction-specific static server response pages. If no matching file for the requested response type is located the appropriate directories are then searched for a file matching the default content type, as defined by the ‘default-response-type’ configuration entry.

By default WebSEAL sends a 302 response when a redirect is required, along with the 38cf0421.html error page. This error page can be customized with different response codes for different response types if a 302 response is not desired.

WebSEAL provides two out-of-the-box (OOTB) JSON response files: management/C/default.json and errors/C/default.500.json. To revert to the legacy WebSEAL behaviour of returning HTML files for all responses, delete these two response files from the management root of your WebSEAL instance.

Parent topic: Web server response configuration

Related concepts

Related tasks

Related reference