I have a ViewScoped
class named SettingsBean ant it has a ManagedProperty
named UserBean which is SessionScoped
and its default getter/setter methods.
In my settingsBean, my problem is when I click the page it enters init
function then it enters destroy
function as soon as it enters init function.
So I encounter with java.lang.nullpointerexception
when I call a function with commandbutton actionListener
to use the list of selected items of a datatable which is lazy.
When I change the scope as SessionBean everything works normally but this problem forces me to use my bean as session scope and I don't want this.
I use JSF-2.2
.
What may cause this problem?