Technical Articles relating to Oracle Development Tools and Frameworks

  • ADF
    April 27, 2011

Integrating ADF and Servlets

Duncan Mills

Inspired by a recent (OK not so recent but I’ve been busy)  OTN Code Harvest article from Frank Nimphius and prompted by a specific customer question along the same lines I’ve put together a simple example project that demonstrates the technique in a very simple manner. Frank is discussing the common case of reusing ADF Business Components Application Module context, however, my sample is a little simpler and is just using a humble POJO for simplicity.

You can download the sample workspace from here: Sharing ADF context with a Servlet.

This sample is based on JDeveloper / ADF (Fusion Middleware Patchset 3) but should upgrade to newer 11.1.1.n versions without a problem. There are no database dependencies.

To try it out, just unzip the sample, make and run index.jspx in the ViewController project.

This code demonstrates how a Servlet within an application can share the same data control context (frame) as the underlying UI pages and Task Flows within that application.

This approach is useful when you are creating integrated applications where servlets are leveraged to add functionality to the application such as AJAX calls or email generation


  1. The Servlet path is mapped to the same pageDef as the required ADF content in the DataBinding.cpx file
  2. The Servlet is registered with the ADF Binding filter in the web.xml file
  3. The "calling" page (or taskflow) will temporarily store the current Data Control Frame name on the session
  4. The servlet will retrieve the data control frame name and use that to access the binding that is required in the correct context

Join the discussion

Comments ( 1 )
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.