The JSF 1.1 spec under section 5.3.1.3 says that a managed bean created within a particular scope, be it a request, session or application scope, should be available through the corresponding EL implicit object requestScope, sessionScope or applicationScope respectively.
As an example I've created the following simple bean:
public class MyBean {
public MyBean() { }
String myValue = "a value";
public void setMyValue(String myValue) { this.myValue = myValue; }
public String getMyValue() { return myValue; }
}
....and configured it my faces-config.xml file as:
<managed-bean>
<managed-bean-name>myBean</managed-bean-name>
<managed-bean-class>MyBean</managed-bean-class>
<managed-bean-scope>request</managed-bean-scope>
</managed-bean>
....finally referencing it within my ADF Faces page using:
<af:inputText value="#{requestScope.myBean.myValue}"/>
But it throws:
javax.faces.el.PropertyNotFoundException: Error testing property 'myValue' in bean of type null
at com.sun.faces.el.PropertyResolverImpl.isReadOnly(PropertyResolverImpl.java:274)
...and so on
I know that I can actually access the bean as #{myBean.myValue}, but my understanding from the JSF spec is that the requestScope approach should work.
What am I doing wrong here? Is it that only attributes, be they Strings or whatever, rather than fully blown objects (be it a backing bean), are accessible via the request/session/applicationScope implicit objects?
Regards,
CM.