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

Lucas Jellema 1

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

One thought on “ADF Binding XML data directly from ADF BC to JSP and JSTL (XML-tags)

  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 ?

Comments are closed.

Next Post

Tom Kyte part II. Using what we have learned

Facebook0TwitterLinkedinIn this post we will tune a query from being hopelessly slow to fast. We will use “explain plan” to analyze the query plan. We will see how Oracle prevents you from doing stupid things. We will also see that preventing hard parses of queries will really speed up your […]