Hi There,

I have a web application that uses JSF 2 and spring webflow that I am attempting to convert to portlets to use in Liferay.

Webflow 2.3.1 does not support JSF2 in portlets according to the docs, so I am using a snapshot build of 2.4 (which according to https://jira.springsource.org/browse/SWF-1550 will do so).

If I take the booking-portlet-faces sample and alter it to use webflow 2.4 and myfaces 2.1.9, then the portlet will load fine in Liferay, but the required js libraries won't be included.

If I attempt to use either the JSF2 reference implmentation, or the Liferay Faces Bridge, then I get a null pointer exception when loading a page with the portlet on it.

I believe the null pointer exception may be a bug in webflow, as when a portlet context, webflow creates a
Code:
org.springframework.faces.webflow.context.portlet.PortletFacesContextImpl
to act as a faces context. The constructor for this is:

Code:
public PortletFacesContextImpl(PortletContext portletContext, PortletRequest portletRequest, PortletResponse portletResponse) {
  application = JsfUtils.findFactory(ApplicationFactory.class).getApplication();
  renderKitFactory = JsfUtils.findFactory(RenderKitFactory.class);
  this.externalContext = new PortletExternalContextImpl(portletContext, portletRequest, portletResponse);
  this.exceptionHandler = JsfUtils.findFactory(ExceptionHandlerFactory.class).getExceptionHandler();
  FacesContext.setCurrentInstance(this);
}
Which works fine in myfaces, however for the JSF2 RI and the Liferay Faces Bridge, the method call
Code:
JsfUtils.findFactory(ExceptionHandlerFactory.class)
results in a class that assumes a faces context already exists - it uses the faces context to determine if the current request is an ajax request.

I am unsure if this is an issue in webflow, or in the underlying libraries assuming that
Code:
getExceptionHandler
will only be called when the faces context is initalised.

Can anyone either point we to a workaround for either issue?

Thanks.