ADF Binding XML data directly from ADF BC to JSP and JSTL (XML-tags)


In this post I discuss how the ADF Binding Framework and the ADF Business Components Model can be used to import model-data as XML into a JSP and more specifically into JSTL-XML tags . It is largely based on the exchange I had with Steve Muench. The article proposes an alternative to the use of JSTL’s SQL tags to select data that is then transformed into XML Document variables within a JSP. This is an approach I used in several previous posts: SVG, XSLT and JSP/JSTL: Generating Digital Gauge or Speedometer Chart based on dynamic data, Generating SVG Graphics in JSPs using JSTL & XSL(T) – from MySQL to Bar Chart and Pie Chart and XSL Transforming XML generated from SQL results using JSTL tags in JSP pages – putting JSTL to the test.

We can make use of the writeXML() method on the ViewObject. This method returns an XML Document with the data from the current VO Row as well as all of its details through the ViewLinks defined for the ViewObject, for as many levels as is required.

See Steve Muench’s article in response to my initial questions: Questions on Exposing XML via Transient Attribute. It all started with one of Steve’s Not Yet Documented ADF Sample Applications:

Using ViewObject writeXML and JSTL XML Tag Library – Illustrates how to use the ViewObject writeXML() method to produce a multi-level XML message for an HR schema-based data model having Departments -> EmployeesInDepartment -> DirectReports->DirectReportJobHistory with a second detail collection under Departments of Deparments -> EmployeesJobHistory. This XML document is then set as a request attribute so that the JSTL XML library can render the multi-level information using XPath expressions. The sample contains both Struts and Model 1 examples (requires the HR schema).

About Author

Lucas Jellema, active in IT (and with Oracle) since 1994. Oracle ACE Director and Oracle Developer Champion. Solution architect and developer on diverse areas including SQL, JavaScript, Docker, Machine Learning, Java, SOA and microservices, events in various shapes and forms and many other things. Author of the Oracle Press books: Oracle SOA Suite 11g Handbook and Oracle SOA Suite 12c Handbook. Frequent presenter on community events and conferences such as JavaOne, Oracle Code and Oracle OpenWorld.

1 Comment

  1. Unfortunately, Sample Application doesn’t not exists  to download on Not Yet Documented ADF Sample Applications > “Using ViewObject writeXML and JSTL XML Tag Library”
    Is it somehow possible for you to provide the sample application ?