Package io.bootique.jetty.servlet
Interface ServletEnvironment
-
- All Known Implementing Classes:
DefaultServletEnvironment
public interface ServletEnvironmentProvides 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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Optional<javax.servlet.ServletContext>context()Optional<javax.servlet.http.HttpServletRequest>request()Returns an optional for HttpServletRequest currently in progress.
-
-
-
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.
-
-