KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I am trying to get session scoped bean data in another Managed bean. When I am doing that value is coming as null and giving java.lang.NullPointerException error. I am new to JSF so keep in mind that I might be missing simple thing. Here is the SessionScoped Bean @ManagedBean @SessionScoped public class UserSessionBean { private superProcessId; //getter setter and other code } Here is the Managed Bean I am trying to get this data @ManagedBean public class AddProcessBean { @ManagedProperty(value="#{UserSessionBean}") private UserSessionBean sessionData; //Getter Setter for sessionData public UserSessionBean getSessionData() { return sessionData; } public void setSessionData(UserSessionBean sessionData) { this.sessionData = sessionData; } public void addAction() { System.out.println(getSessionData().getSuperProcessId()); } }
Tags (comma-separated)
Save Edits
Cancel