问题描述
我正在为JSF创建Facelet组件,以供公司中的其他开发人员使用。为了帮助这些人,我们设置了示例页面,您可以在其中查看工作示例以及在其他页面中复制,粘贴和修改的源代码。
我需要显示一个如何在属性中使用EL的示例,但是如果没有诸如#p $
attribute =< h:outputText value =# />
< h:outputText value = { />
< h:outputText value = myExpression /> ;
< h:outputText value =} />
这种方式有效,但对我来说却很沉闷。如何实现更精简和/或更清洁的目标?
来自:
I am creating Facelet components for JSF to be used by other developers in my company. To help those, we have example pages set up, where you could see working examples and the source code to copy, paste and modify in other pages.
I need to show an examples of how to use EL in attributes, but I cannot get the EL to be printed out as String without an ugly workaround like
attribute="<h:outputText value="#"/> <h:outputText value="{"/> <h:outputText value="myExpression"/> <h:outputText value="}"/>"
It works this way, but looks pretty dull to me. How to achieve my goal leaner and/or cleaner?
From the Expression Language Specification Version 2.2 :
这篇关于如何输出EL为例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!