uCosminexus Application Server, Web Container Functionality Guide

[Contents][Glossary][Index][Back][Next]

2.9.1 Servlet filter provided by Application Server (built-in filter)

In Application Server, a servlet filter (built-in filter) is provided to use the following functionality:

The following table describes the types of built-in filters. Further, references of the functionality that you can use by embedding the built-in filter in a Web application are also described.

Table 2-35 Types of built-in filters

Type of built-in filter Description of functionality Reference manual Reference
Filter for session failover This functionality manages the session information executed in a J2EE application. In the case of failure of the J2EE server, the managed session information is inherited to another J2EE server. uCosminexus Application Server Maintenance and Migration Guide 6.2,
6.4
HTTP response compression filter This functionality compresses the HTTP responses to the HTTP requests for servlets, JSPs, and static contents, in the gzip format. This manual 2.10
Hint
When you build in each filter in the Web application, specify in the order of 'filter for session failover', 'HTTP response compression filter' in the filter mapping definition. The filter for session failover must be deployed before all the built-in filters and user filters.

Note that with Servlet 3.0 or later, you can define a filter by using an API and not the web.xml file. However you cannot use an API to define a built-in filter.

The action of the built-in filter on HTTP requests and HTTP responses, the restrictions on the operation conditions of the built-in filter are explained below:

Organization of this subsection
(1) Action on the HTTP requests and HTTP responses
(2) Restriction on operation conditions

(1) Action on the HTTP requests and HTTP responses

The built-in filter acts on the request header and the request body of the HTTP requests sent from the client, and may delete, add, and change the information. In the same way, the built-in filter may also act on the response header and the response body of the HTTP responses sent from the server. The following table describes the action of the built-in filter on HTTP requests and HTTP responses:

Table 2-36 Action of the built-in filter on HTTP requests and HTTP responses

Type of built-in filter Action on the HTTP request Action on the HTTP response
Filter for session failover -- --
HTTP response compression filter -- When the response body is compressed, gzip is specified in the Content-Encoding header. The response body is compressed in gzip format.

Legend:
--: Not applicable

(2) Restriction on operation conditions

When you use the user filter and the built-in filter simultaneously, there are restrictions on the order in which the built-in filter is invoked in the filter chain.

The following restrictions are explained for each built-in filter:

(a) Restrictions on the filter for session failover

The following table describes the restrictions on the filter used for session failover:

Table 2-37 Restrictions on the filter used for session failover

Type of restriction Description
Restriction on the location The filter for session failover must be invoked first in the filter chain. You need to deploy the filter for session failover before all the user filters and the built-in filter.
Restriction on operation conditions --
Restriction on the other servlet filters deployed before and after the built-in filter --

Legend:
--: Not applicable

(b) Restrictions on an HTTP response compression filter

The following table describes the restrictions on the HTTP response compression filter:

Table 2-38 Restrictions on the HTTP response compression filter

Type of restriction Description
Restriction on the location --
Restriction on operation conditions --
Restriction on the other servlet filters deployed before and after the built-in filter In the case of concurrent use of the HTTP response compression filter and servlet filter that changes the settings of the Content-Length header or the Content-Encoding header by using the setHeader method, addHeader method, setIntHeader method, or addIntHeader method of the javax.servlet.http.HttpServletResponse interface, you need to deploy the servlet filter after the HTTP response compression filter.

Legend:
--: Not applicable