Actually, I should also have asked: at what point is it safe to call FacesContext.getCurrentInstance()? After org.apache.myfaces.webapp.StartupServletContextListener.contextInitialized() is complete?
Eric Jung/X/PH/Novartis 05/18/2007 10:42 AM To "MyFaces Discussion" <[email protected]> cc "MyFaces Discussion" <[email protected]> Subject Re: how to execute one-time start-up code? Hi, Calling FacesContext.getCurrentInstance() returns null from my own ServletContextListener.contextInitialized(), even though I've written the web.xml like so: <listener> <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class> </listener> <listener> <!-- Our context listener must come AFTER MyFaces's ContextListener --> <listener-class>com.myco.MyServletContextListener</listener-class> </listener> This is using JBoss 4.x. Is there any way to force MyFaces' ContextListener to execute first? "Cagatay Civici" <[EMAIL PROTECTED]> 05/18/2007 09:33 AM Please respond to "MyFaces Discussion" <[email protected]> To "MyFaces Discussion" <[email protected]> cc Subject Re: how to execute one-time start-up code? How about a servlet context listener? On 5/18/07, [EMAIL PROTECTED] < [EMAIL PROTECTED]> wrote: Hi, This is a general JSF question; probably not MyFaces-specific. Can anyone tell me how to get one-time initialization code executed during application startup? With Spring and Struts, this was really easy to do. With JSF, it's not obvious to me how to do it. Thanks for any suggestions, Eric _________________________ CONFIDENTIALITY NOTICE The information contained in this e-mail message is intended only for the exclusive use of the individual or entity named above and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivery of the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete the material from any computer. Thank you. _________________________ CONFIDENTIALITY NOTICE The information contained in this e-mail message is intended only for the exclusive use of the individual or entity named above and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivery of the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete the material from any computer. Thank you. _________________________ CONFIDENTIALITY NOTICE The information contained in this e-mail message is intended only for the exclusive use of the individual or entity named above and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If the reader of this message is not the intended recipient, or the employee or agent responsible for delivery of the message to the intended recipient, you are hereby notified that any dissemination, distribution or copying of this communication is strictly prohibited. If you have received this communication in error, please notify the sender immediately by e-mail and delete the material from any computer. Thank you.

