【发布时间】:2011-07-14 13:17:11
【问题描述】:
有 JSF 1.2 两个页面(一个.xhtml 和另一个.xhtml),
通过以下规则包含到当前页面:
...
<c:if test="#{flowScope.Bean.param1}">
<ui:include src="one.xhtml"/>
</c:if>
<c:if test="#{!flowScope.Bean.param1}">
<ui:include src="other.xhtml"/>
</c:if>
...
到目前为止,one.xhtml 与 other.xhtml 的区别仅在于操作参数:
one.xhtml:<h:commandLink action="actionOne">
other.xhtml:<h:commandLink action="actionTwo">
是否可以使用一些通用的xhtml?
而不是one.xhtml和other.xhtml,像这样:
...
<c:if test="#{flowScope.Bean.param1}">
<ui:include src="general.xhtml" param="actionOne"/>
</c:if>
<c:if test="#{!flowScope.Bean.param1}">
<ui:include src="general.xhtml" param="actionTwo"/>
</c:if>
...
谢谢你的帮助。
【问题讨论】:
标签: jsf parameters include reusability