删除冗余属性facelet标记文件jsf

时间:2017-07-24 12:07:36

标签: jsf jsf-2

根据这个链接:

How to create a custom Facelets tag?

我能够创建一个facelet标记文件。

我的CustomGraphicImage.xhtml文件的一部分:

<h:graphicImage style="border: #{border}px solid #000000" height="#{height}" width="#{width}" alt="#{alt}" library="image" name="#{value}" />

我的test.xhtml文件:

<my:ImgPath border="1" value="loading_pt01.gif"></my:ImgPath>

问题是当查看HTML源代码时,仍会出现未定义的属性。在下面的示例中,未定义的标记为alt, height, width

<img src="/demo-project/javax.faces.resource/loading_pt01.gif.xhtml?ln=image" style="border: 1px solid #000000" alt height width>

如何只显示已定义的属性?

我正在考虑使用<c:if>来决定是否显示属性,但这似乎太多了。

0 个答案:

没有答案
相关问题