Moxy Fruvous wrote:I don't have someone around me to ask (at times) boneheaded questions, so I hope the Ranch gives me the space for it.
Sure, that is what the ranch is meant for.
Moxy Fruvous wrote:Unfortunately, I am too green to contribute back at this time.
Not a problem. We have all been green at some point of time.
Moxy Fruvous wrote:So, it is convention, a pre-agreed upon format if you will, that takes the Class Hello, and converts it into 'hello' in Expression Language.
Yes, but note that, like I pointed out earlier, an instance of the class Hello is created. The name of the instance is, by convention, 'hello' and that is used. So, it is like you are using an instance of the class Hello in another place (like we do typically between pure Java classes)
Moxy Fruvous wrote:I would assume then, that if I deviated from Java's convention and called the class 'hello' instead of 'Hello', EL would get lost?
Correct. However, if someone insists on using a different name, that can be done as:
You can then use this 'Hello' within your EL. But, that would be poor convention and also misleading/confusing.
Moxy Fruvous wrote:Second followup, you say EL takes 'hello.name' and uses the getter and setter. So, it has nothing to do with the Java attribute being declared private or public? But, may I assume then that if I deviated from Java's convention, and called the getter method getTheName, then EL would be lost?
Correct. The EL would be lost.
Moxy Fruvous wrote:The whole technology of JavaBeans/JSF Pages, etc., is based on Java syntax conventions that are not enforced by the compiler. Is that accurate?
Correct. You would get an error at runtime if what the EL refers to is not valid. However, some IDEs provide support in the editor by marking wrong expressions in the jsf page with a red line or so (like in a
word processor). So, good tooling support can help you detect this problem at development time.
Moxy Fruvous wrote:What I was wondering though, was if both EL expressions are #{hello.name}, how does it know to use the getter in one instance and a setter in the other instance. It makes perfect sense to me, but what in the code tells the ... the ... server, I guess ... to use the getter vs. the setter?
Yes, like I mentioned earlier, the 'phase' would help the server to decide that.