Oracle® Application Development Framework Developer's Guide
10g Release 3 (10.1.3) B25386-01 |
|
![]() Previous |
![]() Next |
The binding filter is a servlet filter, which is an instance of the oracle.adf.model.servlet.ADFBindingFilter
class. ADF web applications use the ADF binding filter to preprocess any HTTP requests that may require access to the binding context.
The binding filter performs the following functions:
Overrides the character encoding when the filter is initialized with the name specified as a filter parameter in the web.xml
file. The parameter name of the filter init-param element is encoding
.
Instantiates the ADFContext
object, which is the execution context for an ADF application and contains context information about ADF, including the security context and the environment class that contains the request and response object.
Serializes incoming HTTP requests from the same browser (for example, from framesets) to prevent multithreading problems.
Notifies data control instances that they are about to receive a request, allowing them to do any necessary per-request setup.
Notifies data control instances after the response has been sent to the client, allowing them to do any necessary per-request cleanup.
The first time you add a databound UI component to a page using the Data Control Palette, JDeveloper automatically configures the filter in the application's web.xml
file.
To configure the binding filter, JDeveloper adds the following elements to the web.xml
file:
A Servlet context parameter (see Section 5.4.1.1, "Configuring the Servlet Context Parameter")
An ADF binding filter class (see Section 5.4.1.2, "Configuring ADF Binding Filter Class")
Filter mappings (see Section 5.4.1.3, "Configuring the Filter Mapping")
The servlet context parameter specifies which DataBindings.cpx
file the binding filter reads at runtime to define the application binding context. The servlet context parameter is defined in the web.xml
file, as shown in Example 5-2. The param-name
element must contain the value CpxFileName
, and the param-value
element must contain the fully qualified name of the application's DataBindings.cpx
file.
The ADF binding filter implements the javax.servlet.Filter
interface and is defined in the web.xml
file, as shown in Example 5-5. The filter-name
element must contain the value adfBindings
, and the filter-class
element must contain the fully qualified name of the binding filter class, which is oracle.adf.model.servlet.ADFBindingFilter
.
Filter mappings link filters to static resources or servlets in the web application. When a mapped resource is requested, a filter is invoked. Filter mappings are defined in the web.xml
file, as shown in Example 5-6. The filter-name
element must contain the value adfBindings
. Notice that in the example there is a filter mapping for both types of page formats: jsp
and jspx
.
Example 5-6 Filter Mapping Defined in the web.xml File
<filter-mapping> <filter-name>adfBindings</filter-name> <url-pattern>*.jsp</url-pattern> </filter-mapping> <filter-mapping> <filter-name>adfBindings</filter-name> <url-pattern>*.jspx</url-pattern> </filter-mapping>
Tip: If you have multiple filters defined in theweb.xml file, be sure to list them in the order in which you want them to run. At runtime, the filters are called in the sequence they appear in the file.
|