JSF Integration

DWR contains 2 extension points for JSF, a creator and a ServletFilter. The JSF integration is not included in the dwr.jar. It is currently only available in the dwr-noncla.jar which is available for download.

The 'jsf' Creator

An experimental JsfCreator is included with the normal DWR download. You can use this from dwr.xml as follows:

  <creator id="jsf" class="org.directwebremoting.faces.JsfCreator"/>

  <create creator="jsf" javascript="ScriptName">
    <param name="managedBeanName" value="beanName"/>
    <param name="class" value="your.class"/>

This will allow you to make calls into your ManagedBeans from DWR. Please note the init section. This section is required because the JSF creator is not defined in the standard dwr.xml (because of the non-cla issue).

The Servlet Filter

The DWR/Faces filter allows you to access beans from your FacesContext without being officially part of the JSF lifecycle.

In order to use the JsfCreator, you should add the DWR/Faces filter to your web.xml file.



The 2 elements will need to be placed alongside other filter and filter-mapping elements in your web.xml file.

This JSF integration was written by Pierpaolo Follia, with inspiration from an article from thoughtsabout.net.