I don�t think my constructor is being called. Here is the code and the output.
Faces-config
<managed-bean>
<managed-bean-name>UserBean</ managed-bean-name>
<managed-bean-class>com.bean.UserBean</ managed-bean-class>
<managed-bean-scope>session</ managed-bean-scope>
<managed-property>
<description>
Test String</description>
<property-name>strTest</property-name>
<property-class>java.lang.String</ property-class>
<value></value>
</managed-property>
</managed-bean>
public final class UserBean extends Object{
public UserBean(){
this.setTest(�I�m the constructor string�);
}
public void setTest(String test){
this.test = test;
}
public String getTest(){
return test;
//return �I�m from the method�;
}
private String test;
}
In the jsp�.
<f:view>
Test String here -> <h:outputText value=�UserBean.test�/> <-Test String there
</f:view>
If I just return test as it is written I get null basically or output like this�
Test String here -> <-Test String there
If I return the �I�m from the method� string obviously I get�.
Test String here -> I�m from the method <-Test String there
I have also tried adding a string to the value tags in the config file-still null and that wouldn�t have helped anyway. So what is going on? I thought you could have a constructor actually, well, construct in
JSF but this one looks like it is being over-written or something.
correction-the constructor must be called because I put a database connection manager in this constructor and then used it to get a connection and verify a user name that was also passed in....that part worked.
[ June 01, 2007: Message edited by: Pat Peg ]