Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

el

jsf-2

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?

like image 970
Filippo1980 Avatar asked Jan 09 '12 16:01

Filippo1980


People also ask

What's the difference between the$@ and$* variables?

There is no difference if you do not put $* or $@ in quotes. But if you put them inside quotes (which you should, as a general good practice), then $@ will pass your parameters as separate parameters, whereas $* will just pass all params as a single parameter. Clearly, "$@" gives the behaviour that we generally want.

Whats the difference between {} and [] in JavaScript?

The difference between “{}” and “[]” is that {} is an empty array while [] is a JavaScript array, but there are more! In JavaScript, almost “everything” is an object. All JavaScript values, except primitives, are objects. Therefore if you understand objects, you understand JavaScript.

What is the difference between$* and$# in unix?

So basically, $# is a number of arguments given when your script was executed. $* is a string containing all arguments. For example, $1 is the first argument and so on. This is useful, if you want to access a specific argument in your script.


1 Answers

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

like image 62
Fortunato Avatar answered Oct 15 '22 14:10

Fortunato