[snippet-filter:<uri>] stanza

Use the [snippet-filter:<uri>] stanza to configure the snippet filter for a particular resource.

Syntax

[snippet-filter:<uri>]
<location> = <filename>

Description

This filter allows snippets to be inserted into the response for the specified URI.

Options

<uri>
The URI for which the snippet substitution takes place.
<location>
The location at which the snippet is inserted. The location is pattern matched against a single line in the response. The snippet is then inserted immediately before the matching line. The value must represent the entire line that the snippet is to be inserted before. You can use the * and ? wildcard characters in the location pattern. The pattern match for this parameter is case-sensitive.
<filename>
The name of the file which contains the snippet to be inserted. You can specify a path that is relative to the snippet directory in the management root directory. This parameter is case-sensitive.

Usage

You can specify multiple resources and configure multiple locations for each resource. The entries in the stanza must appear in the order in which they will be inserted in the returned page. Only the first match for each configuration entry is updated with the snippet. After a match has been found, WebSEAL progresses to the next configuration entry. If a match is not found for a particular configuration entry, the subsequent entries in the stanza are not processed.

You must include a new line character at the end of the snippet file contents if you want the snippet to be inserted as a separate line. Otherwise, WebSEAL adds the snippet to the start of the matching line.

When you configure a snippet-filter stanza for a resource that is accessed over a virtual junction or a local junction, the <uri> value is a forward slash followed by the resource name. For example, [snippet-filter:/myResource.html].

As a result, a particular [snippet-filter:<uri>] stanza can represent multiple resources. In the preceding example, WebSEAL inserts snippets into the responses when accessing myResource.html over a local junction or virtual junction.

If the configured <filename> value is a non-existent file, WebSEAL fails to restart with a DPWIV0752E Could not open file error.

Default value

None.

Example

[snippet-filter:/stdjunction/sampleResource.html]
*test* = samplesnippet.html
?hello* = samplesnippet2.html