Search code examples
jsfxpageslotus-domino

Getting to ServletContext from ApplicationListener


We are using an ApplicationListener to load some timer libraries that will do regular background work with some of the beans. However at applicationCreated we can't seem to find a way into the ServletContext via the ApplicationEx object. There are a lot of deprecated methods that appear they would have helped. Does anyone know how to traverse to the FacesContext or external ServletContext from ApplicationEx during the applicationCreated method?


Solution

  • We use the preload xpage feature (bit.ly/10rfvEs) of the server but that does not create a session so there is never a FacesContext (get current instance returns null). So we did some tricks to open a link back to the app from the listener which then created the first session and app scope we needed.