Oracle® Application Development Framework Developer's Guide 10g (10.1.3.1.0) Part Number B28967-01 |
|
|
View PDF |
The ADF binding filter is a servlet filter that 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 first time you add a databound component to a page using the Data Control Palette, JDeveloper automatically configures the filter for you 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: 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-3. 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 without the .cpx
extension.
An ADF binding filter class: Specifies the name of the binding filter object, which implements the javax.servlet.Filter
interface.
The ADF binding filter is defined in the web.xml
file, as shown in Example 5-4. 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.
At runtime, when a mapped resource is requested, a filter is invoked. Filter mappings are defined in the web.xml
file, as shown in Example 5-5. 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-5 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 executed in the sequence they appear in the web.xml file. |
At runtime, the ADF 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.