Skip Headers
Oracle® Application Development Framework Developer's Guide
10g (10.1.3.1.0)

Part Number B28967-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Master Index
Master Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

5.4 Configuring the ADF Binding Filter

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.

5.4.1 How to Configure the ADF Binding Filter

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.

5.4.2 What Happens When You Configure an ADF Binding Filter

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.

    Example 5-3 Servlet Context Parameter Defined in the web.xml File

    <context-param>
       <param-name>CpxFileName</param-name>
       <param-value>oracle.srdemo.view.DataBindings</param-value>
    </context-param>
    
    
  • 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.

    Example 5-4 Binding Filter Class Defined in the web.xml File

    <filter>
       <filter-name>adfBindings</filter-name>
       <filter-class>oracle.adf.model.servlet.ADFBindingFilter</filter-class>
    </filter>
    
    
  • 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 the web.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.

5.4.3 What Happens at Runtime

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.

  • Initializes the binding context for a user's HTTP session.

  • 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.