Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
Hey guys, what's the different between binding and value tag?
It's all the same, doesn't it? Modifying and setting the value of a bean property.
What say you?
Independent Programmer - Technology Enthusiast - JUG Leader from JUG Joglosemar
I think originally value tags didn't exist and binding was the only choice. Then a bunch of stale web pages kept Binding in view long after it was no longer the best solution.
Binding is a lot more cumbersome than value expressions. It introduces JSF-specific logic and constructs into what would otherwise be POJOs.
There are uses for bindings, however, just not as many as people actually use. Their primary benefit is that if you're not using a static View template, you can bind the View template to an "anchor" object that serves as container for the dynamic components and then construct the dynamic components in a backing bean, attaching them to their bound parent.
Sometimes the only way things ever got fixed is because people became uncomfortable.
Your second example isn't actually JSF, it's EL going directly out to the view, so neither value nor binding apply. In JSF, you'd bind a value property like this:
Or you could split the difference:
That only works on output. Input value expressions have to reference a single property which will then be set when the form is submitted.
Sometimes the only way things ever got fixed is because people became uncomfortable.