Announcement Announcement Module
Collapse
No announcement yet.
SWF 2.3.1 + JSF Composite Component: Not Working Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • SWF 2.3.1 + JSF Composite Component: Not Working

    Hi,

    I just noticed this unexpected behavior with composite components. It is a known issue (JIRA SWF-1468) which has been set to "resolved" as of inability to reproduce. Nevertheless it still exists.

    Steps to reproduce
    1. Create composite component that contains a composite:insertFacet
    2. Create a flow with one view-state
    3. Create a view that uses the composite component
    4. Run the application and load the page
    5. Reload the page twice (in the same flow state)

    The problem occurs when a <composite:implementation> contains e.g. a <composite:insertFacet> (see example below). If the page is refreshed in the browsers SWF unmarshals a previously saved snapshot (including the JSF component tree). When the deserialization reaches the composite:insertFacet Mojarra's ResourceImpl tries to obtain a resource through the JSF ResourceManager which again is obtained from the current FacesContext. The FacesContext instance isn't set at this point, though, since the deserialization takes place before the "resumed flow" event is fired (which would mean the creation of a FlowFacesContext in FlowFacesContextLifecycleListener).

    I already updated that issue and added a patch for the associated issue project. Could you please reopen it?

    View Markup
    HTML Code:
    <!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:on="http://java.sun.com/jsf/composite/onzin"
      template="/WEB-INF/layouts/standard.xhtml">
      <ui:define name="content">
            <!-- ... -->
            <p><on:onzintag/></p>
            <!-- ... -->
      </ui:define>
    </ui:composition>
    Composite Component Markup
    HTML Code:
    <?xml version='1.0' encoding='UTF-8' ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"
          xmlns:cc="http://java.sun.com/jsf/composite">
        <cc:interface>
        </cc:interface>
        <cc:implementation>
        	<cc:insertFacet name="message" />
            ONZIN
        </cc:implementation>
    </html>
Working...
X