Integrating ADF and Servlets

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 11.1.1.4 (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

Notes

  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
Comments:

This topic was covered by Jobinesh some while ago:

http://jobinesh.blogspot.com/2010/04/invoking-applicationmodule-from-servlet.html

Posted by guest on February 12, 2012 at 04:17 PM GMT #

Post a Comment:
Comments are closed for this entry.
About

Hawaii, Yes! Duncan has been around Oracle technology way too long but occasionally has interesting things to say. He works in the Development Tools Division at Oracle, but you guessed that right? In his spare time he contributes to the Hudson CI Server Project at Eclipse
Follow DuncanMills on Twitter

Note that comments on this blog are moderated so (1) There may be a delay before it gets published (2) I reserve the right to ignore silly questions and comment spam is not tolerated - it gets deleted so don't even bother, we all have better things to do with our lives.
However, don't be put off, I want to hear what you have to say!

Search

Archives
« April 2014
MonTueWedThuFriSatSun
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
    
       
Today