Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

what is difference in access jstl and jsf tags!  RSS feed

 
sudhakar dhavala
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

we use ${} to get any variable in jstl tags but in jsf we use #{}

what is specific difference in using this ???
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moved to the JSF forum.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One's for JSF, one's for JSP. The UEL is supposed to remove the disparity, but since I don't know anything about JSF (that I admit to), I can't really speak to that.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In my opinion, moving the EL information out of the JSP Specification, and into its own mixed up with the JSF stuff was a big mistake. It's completely confusing for anyone not interested in the JSF aspects of the EL.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, and to clarify: this has nothing to do with the JSTL, or with tags. The EL is not the JSTL, and EL expressions are not tags.

 
Tim Holloway
Bartender
Posts: 18705
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Acutally, what they did was get rid of the idosyncratic per-framework expression languages and merge them all into a Unified Expression Language (UEL). Makes the rules more consistent and voids the need for separate parsing, interpreting and support facilities.

The primary difference between the "$" and "#" indicators is that "#" indicates a reference and "$" indicates a value. Specifically, since "#" is a reference, it can be used in situations where an lvalue expression is required.

The JSTL/jsp tags retrieved only values, so they use ""$". However, JSF often updates the references, as for example in the "inputText" controls.

I think in JSF pre-historic times, the use of one or the other might have been briefly mandatory. These days, the "#" notation works for most everything JSF. JSP items, on the other hand, aren't prepared to receive input on their EL properties, so they continue to use the (read-only) "$" notation.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66188
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right, Tim. I understand why they did it -- I just think it was done in a ham-handed way that makes it confusing for people who just want to know how to use the EL in JSP.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!