Class SolutionContextListener

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

    public class SolutionContextListener
    extends Object
    implements javax.servlet.ServletContextListener
    • Field Detail

      • solutionPath

        protected static String solutionPath
      • contextPath

        protected static String contextPath
    • Constructor Detail

      • SolutionContextListener

        public SolutionContextListener()
    • Method Detail

      • contextInitialized

        public void contextInitialized​(javax.servlet.ServletContextEvent event)
        Specified by:
        contextInitialized in interface javax.servlet.ServletContextListener
      • createWebApplicationContext

        protected WebApplicationContext createWebApplicationContext​(String fullyQualifiedServerUrl,
                                                                    javax.servlet.ServletContext context)
        Provide a simple extension point for someone to be able to override the behavior of the WebApplicationContext. To extend or change behavior, you will need to extend WebApplicationContext, and extend SolutionContextListener to override the createWebApplicationContext method. The subclassing is currently required because the initialization code above makes a specific setProperties call on the returned ApplicationContext method by casting it to a WebApplicationContext.

        Tangible example where this would be needed - context.getRealPath("") doesn't work the same way on all platforms. In some cases, you need to pass in a null, not an empty string. For other servers that don't unpack the war, the realPath call may need to be replaced with a parameter defined in the web.xml

        Parameters:
        fullyQualifiedServerUrl -
        context -
        Returns:
      • showInitializationMessage

        public void showInitializationMessage​(boolean initOk,
                                              String fullyQualifiedServerUrl)
      • getContextPath

        protected String getContextPath()
      • getRootPath

        protected String getRootPath()
      • contextDestroyed

        public void contextDestroyed​(javax.servlet.ServletContextEvent event)
        Specified by:
        contextDestroyed in interface javax.servlet.ServletContextListener