Hi I am working on a JSF project, I will like to access some session level variables onto my xhtml UI pages directly without using any managed bean.
Just wanted to know if this is possible and if yes than how?
Thanks
Yes its possible
If the bean doesnot exits then put it in session first
FacesContext.getCurrentInstance().getExternalContext().getSessionMap().put(key,object);
And to use the bean on xhtml page use
<h:outputText value="#{sessionScope.key}" />
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With