Eric
Eric

Reputation: 1973

PrettyFaces and JSF ui:include causing action method to be called twice

I have an xhtml view being rendered via a prettyfaces request. I am running into a problem where the Action mapping from prettyfaces is being executed twice, but only when I have a ui:include tag. The example pretty config is like this:

 <url-mapping id="testRedirector">
      <pattern value="/project/#{lookupBean.projectId}/#{lookupBean.cardNumber}" />
      <view-id value="/lookup.xhtml" />
      <action>#{myController.init}</action>
 </url-mapping>

The .xhtml is like this:

... 

<ui:include src="/header.xhtml">
    <ui:param name="this_tab_class" value="current"/>
</ui:include>

<h:panelGrid columns="4">
...

And upon request to the URL, I see a log call on the myController.init() being executed twice. If I comment out the ui:include, the init is properly only called once. I've experimented wiht the other jsf phase listeners on prettyfaces url-mapping element, but all other enum types result in init() never being called.

My question is, how do I accomplish the same goal of including a predefined header.xhtml, or other predefined component, into a page and not invoke RENDER_REDRAW phase twice? Or is this a pretty-faces specific problem?

Upvotes: 2

Views: 895

Answers (1)

Lincoln
Lincoln

Reputation: 3191

This sounds like a JSF bug. Does this occur when you do not include PrettyFaces?

Upvotes: 1

Related Questions