Announcement Announcement Module
No announcement yet.
Spring Webflow 2.4 Liferay portlet Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Webflow 2.4 Liferay portlet

    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 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
    to act as a faces context. The constructor for this is:

    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();
    Which works fine in myfaces, however for the JSF2 RI and the Liferay Faces Bridge, the method call
    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
    will only be called when the faces context is initalised.

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