Skip directly to searchSkip directly to the site navigationSkip directly to the page's main content

View System Documentation - Servlet Filters

The IBIS-PH View System makes use of Java Servlet Filters which allow for pre and post processing of the original request made and the View System's response. These filter objects allow the capturing and caching of dynamically generated content, graphic type request adjustments based on the user's graphic type preference, gzipping certain responses, and intercepting/redirecting a user to an announcement type page when they first hit the site. This page give a brief description of each the filters, their order, and URL pattern mappings. It does NOT provide any general information about Java Servlet Filters as this information is widely available on the web. See the org.ibisph.filters package in the Java API docs for more detailed information about the filters.

Enabling, Disabling, web.xml, and Init Parameters

The web.xml file controls which filter is applied to which incoming request and in what order. The base org.ibisph.filter _URIPatternFilter abstract class is extended by most of the filters. This class provides the ability to specify additional filter URL pattern mappings so that the filters are not limited to the basic Java servlet/ filter pattern mappings. These additional patterns are defined in the web.xml file as <filter>/<init-param>s. These "init-param"s also contain other properties that are needed to control the filter's behavior. See the web.xml file and the description element for more detailed information about what parameters are available and what their valid values are. To enable/disable a filter, simply delete or comment out the web.xml file's "filter" element(s) (and the child elements) as well as the associated "filter-mapping" element(s). The <filter>/<filter-name> and <filter-mapping>/<filter-name> are used as the filter ID/key.

System's Filter Table

Filter Class
URL Pattern

Set Character Encoding
0 * Filter that simply sets the character encoding for a downstream/chained request. This allows for form character data to be processed as it was served to the browser (consistently) when accessed via a request.getParameter() type call. This typically isn't a problem for those server enviros that have one or two apps and can set the character encoding to the match the app. It can be an issue if the app server is set for some other character set and this app is different. Since ISO-8859-1 is a subset of UTF-8 it shouldn't be an issue but this filter can be used to set explicitly just in case.
1 *.html Provides ability to redirect a user to a URL/page when initially entering the site. Cookie controls if shown.
SVG Graphic Type
Request Parameter
2 /indicator/view/*
Adds/sets the GraphicType request parameter for those HTML page requests that need to display a chart or map.
3 /home/*
Controls creation and distribution of cached/artifacted disk files. Extra init-param property adds this compressed file ext list: ".html", ".svg", ".xml"
GZIP Compression
4 *.html
If browser supports GZIP the system compresses the response to save network bandwidth (and disk space if artifacting).
5 *.jpeg and URI
contains "/graphic/"
Allows for the SVG to be captured and converted to JPEG.
Admin Publish Request
6 /publish/* Enforces that the request is coming from the IBIS-PH Admin System server.

Filter/Request Cross Reference Table

Request Type Mime Type Artifact Compress SVG to JPEG
"HTML_CONTENT" htmlxx-
Indicator Profile (and PHOM)
"HTML_CONTENT" htmlxx-
Index htmlxx-
View Related htmlxx-
Chart Request svg xx-
Chart Request jpegx-x
"HTML_CONTENT" htmlxx-
Module Selectionhtmlxx-
Builder html-x-
Result html-x-
Graphic Request svg -x-
Graphic Request jpeg--x
Configuration xml -x-

Announcement Page Redirection - org.ibisph.filter.announcement

Provides ability to catch an initial request and redirect the user to an announcement type page. This functionality is not recommended because it breaks the site's ability to be crawled/indexed by search engines. This filter utilizes a cookie to keep track of if the page has been shown or not. Filter init parameters provide the associated redirection URL, cookie name and cookie value properties.

Graphic Type - org.ibisph.filter.graphic.GraphicTypeFilter

This filter sets the graphic type request parameter (named "GraphicType") for HTML pages that contain a map or chart graphic image. This parameter is needed so that the XSLT will know to build SVG code using the HTML "object" and "embed" elements instead of the HTML "img" element (used for JPEG, BMP, GIF, PNG etc.).

The IBIS-PH View System delivers two types of chart/map graphics. Standard bitmap images that all browsers can display without any special plugins needed or a higher quality, interactive vector based SVG images which requires a plugin. The graphic type is specified in two ways: 1) user specified preference which uses Javascript to store a cookie on the user's local machine named "GraphicType" with a value of "SVG" or "JPEG". 2) on the URL which overrides the user preference graphic type - e.g. explicitly set by the user when making the request. If nothing is specified the system defaults to JPEG since support for this type of graphic is built into all browsers. The filter only wraps the request if the "GraphicType" cookie or a request parameter named "GraphicType" is set to "SVG". As stated above, the request parameter is passed to the XSLT/XML transformation so that the XSLT can build the appropriate HTML elements for the desired chart/map image/graphic type. The wrapped request path adjustment is needed for the optional downstream artifacting filter. Without this semi kludge, the artifacting filter would save both a JPEG type pages and an SVG type pages using the same URI path resource name. This causes all subsequent requests for that artifacted resource to return the page as it was first built. So if the first request for that page had was built to use a bitmap "img" element then even if the user had their graphic type preference set to SVG, they would get the JPEG page and vice versa.

Listed below are the pages that display charts and/or maps:
  • Indicator Profile View pages
  • Complete Indicator Profile pages
  • PHOM Indicator Profile View pages
  • PHOM Complete Indicator Profile pages
  • Query Result pages

Artifact - org.ibisph.filter.artifact

Controls creation and distribution of cached/artifacted disk files. If the request's path (URI or path info - controlled via filter init parameters) does not match the path pattern property list then normal downstream filter/servlet request/response processing is performed. Else if the path does match one of the patterns then the artifact directory is checked for the requested resource. If found it simply streams back the file and short circuits the rest of the downstream filter/servlet request/response processing. If it matches and the resource is not found then the current response is replaced with a wrapped response and normal processing continues. When the normal processing of the request/response has been completed, the wrapped response's contents are then saved to the artifact directory and streamed back to the user. This filter does two optional base path adjustments: 1) If the user's browser accepts compression and if the filter is configured with a compression path suffix (init parameter named: CompressedAtrifact.BasePathSuffix) and if the request path pattern matches (see the CompressedFilePattern.MatchList init parameters) then the base path appends the value of the init parameter to the path. 2) A similar thing is done with the SVG graphic type except instead of checking for the browser supporting "gzip", the request is checked for a graphic type parameter and value. If the graphic type parameter and value are found and match then the path is appended with the value of the parameter (see the GraphicType.RequestParameterName and GraphicType.RequestParameterValue init params).

GZIP Response Content Compression - org.ibisph.filter.gzip.Filter

Most web and application servers now support GZIP compression of response content. However, neither Utah's front end Apache proxy server nor the Utah Tomcat Java application server have page response compression enabled. Also, the IBIS-PH View application does not know which app server or version it will be deployed to so a simple filter was developed to allow fine grained control of compressing text response files. Because some browsers can not or are set to not accept GZIPped content, this filter checks the request's HTTP header for GZIP support (mime type). If the browser does accept GZIP compression then the response is wrapped with a buffer that captures the normal downstream response. When the response is closed the buffered contents are compressed and streamed back.

SVG to JEPG - org.ibisph.filter.graphic.SVGToJPEGFilter

All IBIS-PH View charts and maps objects generate SVG. This filter enables the system to deliver standard JPEG type chart and map graphic images. This filter is based on the open source BATIK package that provides many vector and bitmap graphic image conversion objects. If a request is for a JPEG resource, a buffering response wrapper is created. The normal SVG content is captured by the wrappered response and when finished, the SVG contents are converted to a JPEG graphic image and streamed back. Note that this filter does NOT have to deal with the "GraphicType" cookie/parameter as these are only used when creating the container page (which contains the graphic specific request HTML elements).

Admin Publish Request -

Checks that the request is being made from a specific IP address or domain. Simple filter that enforces that the request is coming from an the IBIS-PH Admin System server. If requester's ip address does not match that the specified init parameter/property value then an HTTP insufficient privs is returned. Otherwise the request is passed through for processing. This filter is basically used to make sure that the publish request is coming from the data admin application.
The information provided was retrieved on: Wed, 22 September 2021 1:52:10.

Content updated: Wed, 4 Nov 2015 09:26:28 MST