On Tue, Jun 11, 2013 at 8:17 AM, John D. Ament <[email protected]>wrote:
> Don't forget, most of these specs expect javabeans - POJOs w/ private
> fields & getters/setters/issers.
>
>
I wanted John's earlier point mentioned again. this is how i learned
it....as I learned Java EE via Java EE 6 tutorial and JSF reference
implementation (Glassfish/Mojarra).
Java EE 6 tutorial (I'm paraphrasing here) taught the following (and I'm
referring to points you made Jose in an earlier email)...
1. xhtml file should reference (public) getter/setter methods of 'managed
beans'
2. managed beans should contain (public) getter/setter methods to 'access'
(private) managed bean attributes.
Jose, you said that you accidentally defined bean attributes as 'public'
instead of 'private', and then you experienced this error. Now, my
question, still...is the 'caused by exception' appropriate/correct
according to 'spec'?
I believe TomEE is working as designed (or as according to Java EE (6)
spec/tutorial and/or according to 'reference implementation' (RI))...
1. an exception is raised when 'public' getter/setter methods are available
for 'public' attributes; interesting, this confuses TomEE (or CODI);
confuses bean manager how to access bean attributes... via public
getter/setter methods OR public attributes? see below...
public String varA;
public String getVarA() {
return varA;
}
public void setVarA(String varA) {
this.varA = varA;
}
xhtml:
<h:outputText value="#{bean.varA}"/>
2. 'no' exception is raised when developer develops software, um, according
to Java EE spec/tutorial... private bean attributes, public getter/setter
methods, xhtml referencing bean attributes via public getter/setter
methods; this makes for a happy TomEE/CODI/beanmanager/camper! Life is
good! :-)