Hello!
I want to develop one interesting project. Two people are able to
exchange with messages via
Java Message Service.
Unfortunately I cannot anyway resolve one problem. I want to display message on
JSF page as soon as it is arrived.
For that I suppose I need FacesContext instance in MDB. Unfortunatelly all methods I have tried to inject FacesContext failed.
1. FacesContext.getCurrentInstance() doesn't work
2. @Inject FacesContext fc; ----- doesn't work
3. I tried to make my mdb also a managed bean by @ManagedBean annotation and then inject FacesContext via @ManagedProperty(value="#{facesContext}") but this doesn't work too.
Can anybody tell me what to do to display arrived message immediately on JSF page?
My opinion is to use FacesContext and then look up needed UIComponent via facesContext.getViewRoot().findComponent("responseForm:responseText");
Thank you!