开发者

Change dynamic part of an snippet that is included via JSF-2.0 templateing

I have a problem with the JSF-2.0 templating mechanism. I implement some snippet that are included to template file. But one of my snippet contains dynamic content.

I do not get an error. But nothing is replaced in my snipplet! The result do only contain "No link list could be found" string. Do anybo开发者_JAVA百科dy know why?

Thanks

The snippet code

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
  xmlns:ui="http://java.sun.com/jsf/facelets">
    <div>
    <ui:insert name="linkList">No link list could be found</ui:insert> 
    </div>
    © MyCompany
</ui:composition>

The template code

  ...
  <div class="footer">
    <ui:insert name="footer">Footer</ui:insert>
  </div>
  ...

The side where specify the template content

...
<ui:define name="footer">
  <ui:include src="/snippets/footer.xhtml" />
</ui:define>
...
<ui:define name="linkList">
link structure for the footer
</ui:define>


The following line you have in snippet is -

<ui:insert name="linkList">No link list could be found</ui:insert>

is for templating and it should be in the template.

Include the snippet in the same way you have included the footer. Using

<ui:include src="snippet.xhtml" />
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜