Class JettyEmulator

    • Constructor Detail

      • JettyEmulator

        public JettyEmulator​(org.eclipse.jetty.util.resource.Resource contentRoot,
                             String descriptor,
                             String contextPath)
      • JettyEmulator

        public JettyEmulator​(org.eclipse.jetty.util.resource.Resource[] contentRoots,
                             String descriptor,
                             String contextPath)
        new a jetty emulator
        Parameters:
        contentRoots - the content roots.
        descriptor - specify the web.xml, if null then use /WEB-INF/web.xml that in contentRoots
        contextPath - specify the context, if null then use "/"
    • Method Detail

      • getHost

        public String getHost()
        Description copied from interface: Emulator
        get the host address the emulator bound. normally, it should be "127.0.0.1".
        Specified by:
        getHost in interface Emulator
        Returns:
        host address
      • getPort

        public int getPort()
        Description copied from interface: Emulator
        get the port number the emulator bound.
        Specified by:
        getPort in interface Emulator
        Returns:
        port number
      • getContextPath

        public String getContextPath()
        Description copied from interface: Emulator
        get the context path of the application
        Specified by:
        getContextPath in interface Emulator
        Returns:
        the context path
      • getAddress

        public String getAddress()
        Description copied from interface: Emulator
        get the URL address.
        Specified by:
        getAddress in interface Emulator
        Returns:
        URL.
      • getServletContext

        public javax.servlet.ServletContext getServletContext()
        Description copied from interface: Emulator
        get the reference of servlet context in the emulator.
        Specified by:
        getServletContext in interface Emulator
        Returns:
        servlet context
      • getSessionId

        public String getSessionId()
        Description copied from interface: Emulator
        get the session ID of last request.
        Specified by:
        getSessionId in interface Emulator
        Returns:
        ID or null if no session created.