【发布时间】:2012-02-02 07:28:06
【问题描述】:
我有如下复合组件:
<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:cc="http://java.sun.com/jsf/composite"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:c="http://java.sun.com/jsp/jstl/core">
<cc:interface>
<cc:attribute name="path" shortDescription="Page Title" type="String"/>
</cc:interface>
<cc:implementation>
<ui:include src="#{cc.attrs.path}"/>
</cc:implementation>
</html>
上面代码的问题是#{cc.attrs.path}被解析为null。如果src 是硬编码的,那么ui:include 可以正常工作。
尝试检查#{cc.attrs.path} 和h:outputText 并且路径显示正确,这意味着仅在ui:include EL 未解析的情况下。有什么帮助吗?
【问题讨论】:
标签: jsf-2 facelets composite-component