Version 2.0

Historical note: OXF 2.0 was released on July 10, 2003

New in version 2.0.2

New XForms wizard example

The OXF Showcase Application includes a new example that demonstrates how to build wizards in OXF using XForms.

issue with <view> element in web application controller configuration

The Web Application Controller did not understand configuration files (usually in page-flow.xml) when no <view> element was declared. When no <view> element was declared, a null pointer exception was thrown. This issue is resolved in OXF 2.0.2.

Issue with XUpdate processor

Caching in the XUpdate processor was too aggressive, causing the debug statement on the config input, or upstream in the pipeline on processors leading to this input not to be printed. In some very rare cases, this could have caused an old version of the XUpdate program to be used. This issue is fixed in OXF 2.0.2.

Issue with command line applications

Command line applications using OXF did not work because incorrect JAR files were referenced from the MANIFEST.MF bundled inoxf.jar. This is issue is fixed in OXF 2.0.2.

NullPointerException in URL generator

The URL generator could throw a NullPointerException when using configurations containing only an <url> element and no content-type. This issue is fixed in OXF 2.0.2.

New in version 2.0.1

Issue with Weblogic and Tomcat

In WebLogic 7, WebLogic 8.1 and Tomcat (with Sun's JDK 1.3), the JAR class loader doesn't know how to determine the last modified date of a resource contained in a JAR file. Under those circumstances, the OXF 2.0.0 cache considers that those resources can not be cached. This problem is fixed with OXF 2.0.1. If you are running WebLogic or Tomcat (with JDK 1.3), you should upgrade to OXF 2.0.1. This upgrade will enhance your application's performance.

Issue with WAR files on Tomcat

When Web applications are deployed on Tomcat in the form of compressed WAR files, and the application resources are stored in the WAR file, OXF 2.0.0 is not able to determine the last modified date of the resources. Consequently, caching was not performed on those resources. OXF 2.0.1 can determine the last modified date of the resources even when they are packaged in a compressed WAR. In this scenario, users will notice that their applications will run much faster with OXF 2.0.1.

JavaServer Faces (JSF) examples on Tomcat 4.1.x and Weblogic 7.0 and 8.1

The JSF examples now work with Tomcat 4.1.x and WebLogic 7.0 8.1. The version of JSTL that shipped with the JSF Reference Implementation Early Access 4 was not compatible with JSP 1.2. OXF 2.0.1 ships with a version of JSTL compatible with JSP 1.2, supported by Tomcat 4.1.x and WebLogic. In addition, some fixes for WebLogic have been introduced. Please read the updated installation instructions for more details.

Packages names

Some of the classes exposed by OXF to allow applications to implement custom processors have been moved to new packages. The Processor API section documents the new package names. You should also recompile all your custom processors when switching to OXF 2.0 (or later) to make sure that you are using valid package and class names.

Deployment descriptor

The Web application deployment descriptor, web.xml changed significantly with the 2.0 release. The OXF initialization parameters are now declared in context-param elements instead of servlet/init-param elements. The OXF engine can be used from a variety of sources and the initialization parameters must be accessible from a servlet, filter or context listeners.

Custom processors with no output

The Processor API chapter now explains how to write processors with no output in Java using the OXF processor API.

New in version 2.0

New web application controller

The Web Application Controller (WAC) is the heart of an OXF Web application. It maps incoming user requests to individual pages and defines how each page is built out of a model and a view, according to the model-view-controller (MVC) architecture. It also defines which XForms model is used for a given page.

In addition to these existing features, the new WAC in OXF 2.0 allows you to declare the entire site navigation logic (also known as page workflow). With a central place where the navigation logic is defined, pages can be developed completely independently from each other. To implement page navigation, the WAC now supports actions and action results.

The new WAC helps you design your Web application with a complete separation between:

  • Site Logic: what pages are brought up and when, as well as how navigation happens is orchestrated from page to page.
  • Page Logic (the Model in MVC): for example, how data entered by the user is validated and then used to retrieve and update data in a database.
  • Page Layout (the View in MVC): how information is laid out in a Web page in order to be presented to the user.
  • Site Presentation: layout and look and feel common to all the pages in your Web application or Web site, e.g.: site navigation menus, table backgrounds, or number formatting.

Figure 1: Separation of concerns
in an OXF application

Other improvements to the Web Application Controller include:

    This version of the WAC is backward compatible with the OXF 1.x WAC, meaning that your current configuration file will work out of the box with OXF 2.0.

    XForms improvements

    Custom attributes

    In version 1.5.2, attributes of XForms controls in the namespace were copied to the generated HTML elements. This version introduces new attributes in the namespace (in particular the appearance attribute on submit controls). As of version 2.0, attributes are copied if they are in a namespace and this namespace is not The namespace is left unchanged when the attribute is copied. Please refer to the XForms section for more information.

    Submit controls

    New XForms submit controls have been introduced to support submit images (corresponding to the HTML <input type="image">) and HTML links that behave like submit buttons. The submit controls can be configured to set values in the instance. See the XForms Submit Controls example for more information.


    Namespaces support

    Custom namespaces can now be used in the XForms instance. For example, you can declare an XForms model like:

    <a:form xmlns:a="">
    <b:element xmlns:b=""/>

    If you use namespaces in the XForms instance, you need to use prefixes when referring to an instance element or attribute in the ref attribute of XForms controls. For example, you can refer to the instance above in a text field with:

    <xforms:group ref="x:form">
    <xforms:input xmlns:y="" ref="y:element"/>

    Note that the prefixes used here (x and y) are different from the one used on the instance (a and b). This is perfectly legal as long as the prefix used in the ref attribute maps to the same URI as the one used in the XForms instance.

    You can declare your XForms instance using a default namespace. e.g.:

    <form xmlns="">

    To refer to an element or an attribute of an instance with a default namespace you need to declare a prefix and use it in the ref attribute. For example:

    <xforms:group ref="x:form">
    <xforms:input ref="x:element"/>


    In the latest W3C XForms recommendation (12 November 2002) the xforms:label element was renamed in xforms:label. OXF now supports xforms:label as a synonym for xforms:label (still supported for backward compatibility).

    Form name

    You now set the name of the generated HTML form by setting the id attribute on the <xforms:model> element. If this attribute is not set, the form name is "xforms".

    Struts portlets support

    The Servlet Include Generator is used to call a URI within the Servlet container that runs OXF. The URI must return well-formed XML. This processor can effectively implement portlets in conjunction with the Struts/OXF integration.

    SQL processor improvements

    CLOB support

    The SQL Processor Supports reading from and writing to CLOBs. The code is JDBC compliant whenever possible. In addition, it also implements specific support for Oracle under Tomcat 4.1.

    When doing insertions of strings and XML fragments, it is possible to specify a SQL type, for example:

    <sql:param type="oxf:xmlFragment" sql-type="clob" select="/document"/>

    This causes the SQL Processor to use the CLOB APIs to set the value. The following statement causes the same value to be written as a SQL VARCHAR type instead:

    <sql:param type="oxf:xmlFragment" sql-type="varchar" select="/document"/>

    Iterations in <sql:param>

    <sql:param> supports a new separator attribute. When that attribute is present, the result of the XPath expression in the select attribute is interpreted as a node-set. One query parameter is set for each element in the node set, separated by the characters in the separator. For example:

    select * from ps_book
    where book_id in (<sql:param type="xs:int" select="/query/book-id" separator=","/>)

    Transaction support

    OXF executes each HTTP request in a single SQL transaction.

    JavaServer Faces integration

    Supports the Early Access 4 implementation of JSF. This allows using OXF to implement a JSF application's look and feel. For more information, visit Using OXF with JavaServer Faces (JSF).

    Other improvements


    Transformers are now unified and pluggable. OXF supports XSLT and JAXP (TrAX) transformers, and ships with the following implementations:

    • Xalan 2.5.1 Interpreter
    • Xalan 2.5.1 Compiler (XSLTC)
    • Saxon 6.5.2
    • Saxon 7.5.1 (supporting a subset of XSLT 2.0)
    • Joost 20030502 (streaming transformer)

    URL generator

    Supports loading and parsing of any HTML document through the HTMLTidy library.

    Configurable serializers

    As of versin 2.0, it is possible to configure the HTML, XML and Text serializers (DOCTYPE, encoding, formatting, etc.). By default, the HTML Serializer outputs an HTML 4.01 transitional doctype.

    Image server

    In addition to scaling and cropping images, the Image Server now supports a set of basic drawing operations, including drawing rectangles and straight lines, that can be performed over existing images

    Request generator

    When specifying "/request/body" in the list of included parameters, the Request Generator parses the body of request. This allows to implement Web Services.

    File serializer

    The File Serializer now allows better control on the output file format.

    Validation processor

    The Validation Processor allows schemas (W3C or RelaxNG) to import sub-schemas via oxf: URL.

    Resource server

    The Resource Server allows customization of the content type based on file extension. In addition, cache control HTTP headers are set so that resources can be cached by clients with Tomcat 4.1 even when security constraints are defined in web.xml.

    Url resource manager

    This new extension to the Resource Manager allows to load resources from a remote Web server or version control system.

    New processors

    • LDAP Processor - Supports querying an LDAP server through JNDI and filtering out the resulting attributes.
    • XQuery Processor - Supports transforming XML documents based on the XQuery specification.
    • XUpdate Processor - Supports updating XML documents based on the XUpdate specification.
    • Chart Processor - Support for charts based on the JFreeChart engine. This processor can either stream images to a client web browser, or save them on disk to allow for caching if the charts are to be reused.
    • PDF Serializer - This processor easily converts XML documents to PDF file, utilizing XSL-FO and the Apache FOP library.
    • Yahoo Instant Messaging Processor - Support for sending and receiving Instant Messages though the Yahoo service.
    • Scheduler Processor - OXF now supports scheduling tasks implemented as XML pipelines. A task can be started, stopped, and executed at a specific time or at a regular interval.
    • Initialization and Destruction Listeners - Support for Servlet context initialization and destruction listeners, implemented as XML pipelines.
    • Email Processor - Support for sending email messages.
    • Excel Import and Export - Support for Excel Import and Export.