$ {}和#{}之间有什么区别? [英] What are the differences between ${} and #{}?
本文介绍了$ {}和#{}之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在用JSF2编程,并且NetBeans使用#{}
创建了许多包含表达式的页面.但是有时候在网上我发现${}
是同一件事!
I'm programming in JSF2 and NetBeans creates many pages with #{}
that contains an expression. However sometimes on the web I found ${}
for the same thing!
有什么区别吗?他们是什么?
Are there any differences? What are they?
推荐答案
-
#{}
用于 延迟表达式 (已解决) 取决于页面的生命周期),可用于阅读或 从 bean 写入或写入方法. -
${}
是用于 立即解决 的表达式 遇到他们就解决了.它们是只读的. #{}
are for deferred expressions (they are resolved depending on the life cycle of the page) and can be used to read or write from or to a bean or to make a method call.${}
are expressions for immediate resolution, as soon as they are encountered they are resolved. They are read-only.
您可以在此处了解更多信息: http://docs.oracle .com/javaee/6/tutorial/doc/bnahr.html
You can read more here: http://docs.oracle.com/javaee/6/tutorial/doc/bnahr.html
这篇关于$ {}和#{}之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文