Uses of Interface
com.sun.net.httpserver.HttpHandler
Packages that use HttpHandler
包
描述
Provides a simple high-level Http server API, which can be used to build
embedded HTTP servers.
-
Uses of HttpHandler in com.sun.net.httpserver
Methods in com.sun.net.httpserver that return HttpHandler修饰符和类方法描述static HttpHandler
SimpleFileServer.createFileHandler
(Path rootDirectory) Creates a file handler that serves files from a given directory path (and its subdirectories).abstract HttpHandler
HttpContext.getHandler()
Returns the handler for this context.static HttpHandler
HttpHandlers.handleOrElse
(Predicate<Request> handlerTest, HttpHandler handler, HttpHandler fallbackHandler) Complements a conditionalHttpHandler
with another handler.static HttpHandler
Returns anHttpHandler
that sends a response comprising the givenstatusCode
,headers
, andbody
.Methods in com.sun.net.httpserver with parameters of type HttpHandler修饰符和类方法描述static HttpServer
HttpServer.create
(InetSocketAddress addr, int backlog, String path, HttpHandler handler, Filter... filters) Creates anHttpServer
instance with an initial context.static HttpsServer
HttpsServer.create
(InetSocketAddress addr, int backlog, String path, HttpHandler handler, Filter... filters) Creates anHttpsServer
instance with an initial context.abstract HttpContext
HttpServer.createContext
(String path, HttpHandler handler) Creates aHttpContext
.static HttpHandler
HttpHandlers.handleOrElse
(Predicate<Request> handlerTest, HttpHandler handler, HttpHandler fallbackHandler) Complements a conditionalHttpHandler
with another handler.abstract void
HttpContext.setHandler
(HttpHandler handler) Sets the handler for this context, if not already set.Constructors in com.sun.net.httpserver with parameters of type HttpHandlerModifierConstructor描述Chain
(List<Filter> filters, HttpHandler handler) Creates aChain
instance with given filters and handler.