Interface ServletEnvironment

  • All Known Implementing Classes:
    DefaultServletEnvironment

    public interface ServletEnvironment
    Provides access to servlet spec objects active at any particular moment. Normally used by the services that operate in a context of a web request.

    Take extra care to avoid inadvertently caching returned objects as they should not be retained once they go out of scope of Jetty threads.

    • Method Detail

      • context

        Optional<javax.servlet.ServletContext> context()
      • request

        Optional<javax.servlet.http.HttpServletRequest> request()
        Returns an optional for HttpServletRequest currently in progress. Will only return a non-empty Optional when invoked within an ongoing request thread.
        Returns:
        an optional for HttpServletRequest currently in progress.