I new to Java and JSf, am getting null pointer error when accessing a getter value from backing bean in controller. Here is the code snippet :
JSP; input text area and am able see the sysout in setter the value submitted from page and not able to access the getter values. faces-config.xml
<managed-bean>
<managed-bean-name>researchHisttoryController</managed-bean-name>
<managed-bean-class>com.controller.ResearchHisttoryController</managed-bean-class>
<managed-bean-scope>session</managed-bean-scope>
<managed-property>
<property-name>history</property-name>
<property-class>com.researchhistory.model.ShipmentHistory</property-class>
<value>#{history}</value>
</managed-property>
</managed-bean>
<managed-bean>
Controller class:
private ShipmentHistory history;
//getters and setter followed;
am accessing varaible from ShipmentHistory class
as
getHistory.getTrackNumber; NPE error
ShipmentHistory.java
private String trackNumber;
//getters and setters
can please help me out where am doing wrong. Thanks for your time.