|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ankit Garg wrote:With the dot operator, you have to follow the java identifier naming rules. The [] operator is there to overcome this limitation...
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
If the first is a bean then the second must follow java naming rules for identifiers
[My Blog]
All roads lead to JavaRanch
1) If the expression has a variable followed by a dot, the left-hand variable MUST be a map or a bean.
2) The thing to the right of the dot MUST be a Map key or a bean property.
3) And the thing on the right must follow normal java naming rules for identifiers.
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
JSP.2.3.1 Overview
...
The . operator can be used as a convenient shorthand for property access when the property name follows the conventions
of Java identifiers, but the [] operator allows for more generalized access.
...
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Here, in EL, the Maps are implicit objects of the scopes, then the keys are strings, so does it need to follow the Java naming rules for identifiers?
Regards,
Amit
amit punekar wrote:
Let's see one example.
Consider you have set a attribute named "my.name" in session using
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
I'm not asking about the left hand side part of the dot operator, but, right hand operator! And I also mentioned that, the dot operator should be used with a Map or JavaBean!
Regards,
Amit
amit punekar wrote:Hi,
Would you be able to gives names to the properties(instance fields) of your JavaBean which do not adhere to the Java naming convention standards?
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
But, mu doubt is, why we need to follow Java naming rules for identifiers for the left hand side part of the dot operator in the case of right hand side is a Map?
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|
Stringvalue Stringvalue blablabla succeeded Stringvalue
|BSc in Electronic Eng| |SCJP 6.0 91%| |SCWCD 5 92%|