I think I am misunderstanding how to use @ManagedProperty. I tried this:
=======Test2.java========
@ManagedBean
public class Test2 {
@ManagedProperty(value="#{test1}")
private Test1 t;
public String getMessage() {
return "I am Test2, message from Test1 is " + t.getMessage();
}
}
=======Test1.java========
@ManagedBean
public class Test1 {
public String getMessage() {
return "I am Test1";
}
}
======test.xhtml=========
...
#{test2.message}
...
=======Result========
[Mojarra 2.0.0 (Beta1 b13)]
SEVERE: JSF will be unable to create managed bean test2 when it is requested. The following problems where found:
- Property t for managed bean test2 does not exist.
I suspect that I am overlooking the obvious. What did I miss?
Thanks!
- Marty
http://www.coreservlets.com
[Message sent by forum member 'martyhall' (hall_at_coreservlets.com)]
http://forums.java.net/jive/thread.jspa?messageID=364245