com.gisgraphy.webapp.listener

## Class StartupListener

- java.lang.Object
- - com.gisgraphy.webapp.listener.StartupListener

- All Implemented Interfaces:
    EventListener, javax.servlet.ServletContextListener

      public class StartupListener
      extends Object
      implements javax.servlet.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 GenericDao or service level to avoid LazyInitializationException. Hibernate.initialize() works well for doing this.

  Author:
    Matt Raible

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StartupListener()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)` Shutdown servlet context (currently a no-op method).
    `void` | `contextInitialized(javax.servlet.ServletContextEvent event)`
    `static void` | `setupContext(javax.servlet.ServletContext context)` This method uses the LookupManager to lookup available roles from the data layer.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StartupListener

          public StartupListener()

  - ### Method Detail

    - #### contextInitialized

          public void contextInitialized(javax.servlet.ServletContextEvent event)

      Specified by:
        `contextInitialized` in interface `javax.servlet.ServletContextListener`

    - #### setupContext

          public static void setupContext(javax.servlet.ServletContext context)

      This method uses the LookupManager to lookup available roles from the data layer.
      Parameters:
        `context` - The servlet context

    - #### contextDestroyed

          public void contextDestroyed(javax.servlet.ServletContextEvent servletContextEvent)

      Shutdown servlet context (currently a no-op method).
      Specified by:
        `contextDestroyed` in interface `javax.servlet.ServletContextListener`
      Parameters:
        `servletContextEvent` - The servlet context event

Copyright © 2015. All rights reserved.