我得到一个包含会话作用域bean的xhtml页面。现在我想在另一个html页面中使用这个页面两次,一次在屏幕的左侧,一次在屏幕的右侧。如果我包含它,它引用了相同的bean,我如何使它们独立,而不是用不同的bean编写html?
发布于 2014-05-05 20:06:55
你需要使用标签来应用这个概念。您可以创建自己的标记,并将它们添加到xhtml页面标记库中。
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:s="http://jboss.com/products/seam/taglib"
xmlns:p="http://primefaces.prime.com.tr/ui"
xmlns:taglibname="http://panorosys.com/products/taglibname/taglib"
template="/WEB-INF/templates/clrp-template.xhtml">然后,您应该像预期的那样在html中使用两次实现的页面。为此,您可以水平创建两个div,并在这两个div上使用此标记库。
<div class="box1">
<clrp:userlist />
</div>
<div class="box2">
<clrp:userlist />
</div>希望这能有所帮助。
https://stackoverflow.com/questions/23466541
复制相似问题