org.appfuse.webapp.listener
Class StartupListener

java.lang.Object
  extended by org.springframework.web.context.ContextLoaderListener
      extended by org.appfuse.webapp.listener.StartupListener
All Implemented Interfaces:
EventListener, ServletContextListener

public class StartupListener
extends ContextLoaderListener
implements ServletContextListener

StartupListener class used to initialize and database settings and populate any application-wide drop-downs.

Keep in mind that this listener is executed outside of OpenSessionInViewFilter, so if you're using Hibernate you'll have to explicitly initialize all loaded data at the Dao or service level to avoid LazyInitializationException. Hibernate.initialize() works well for doing this.

Author:
Matt Raible

Constructor Summary
StartupListener()
           
 
Method Summary
 void contextInitialized(ServletContextEvent event)
           
static void setupContext(ServletContext context)
           
 
Methods inherited from class org.springframework.web.context.ContextLoaderListener
contextDestroyed, createContextLoader, getContextLoader
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.servlet.ServletContextListener
contextDestroyed
 

Constructor Detail

StartupListener

public StartupListener()
Method Detail

contextInitialized

public void contextInitialized(ServletContextEvent event)
Specified by:
contextInitialized in interface ServletContextListener
Overrides:
contextInitialized in class ContextLoaderListener

setupContext

public static void setupContext(ServletContext context)


Copyright � 2002-2006