What are the differences between ${} and #{}?

后端 未结 5 1013
北恋
北恋 2020-12-22 21:09

I\'m programming in JSF2 and NetBeans creates many pages with #{} that contains an expression. However sometimes on the web I found ${} for the sam

5条回答
  •  囚心锁ツ
    2020-12-22 21:46

    • #{} 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.

    You can read more here: http://docs.oracle.com/javaee/6/tutorial/doc/bnahr.html

提交回复
热议问题