Class Container


  • public final class Container
    extends Object
    Utility for determining the Servlet Container the application is running in. Currently supported containers: Tomcat, Resin, Orion, OC4J, WebLogic, HPAS, JRun, Websphere.

    Usage:

    if (Container.get() == Container.TOMCAT) { .... }
    Version:
    $Revision: 1.2 $
    Author:
    Joe Walnes
    • Constructor Detail

      • Container

        public Container()
    • Method Detail

      • get

        public static int get()
        Get the current container.
      • searchForClosestClass

        private static String searchForClosestClass​(Map classMappings)
        Walk up the classloader hierachy and attempt to find a class in the classMappings Map that can be loaded.
        Returns:
        Name of the match class, or null if not found.