public class HTTPServer.VirtualHost.ContextInfo extends Object
ContextInfo class holds a single context's information.| 构造器和说明 |
|---|
ContextInfo(String path)
Constructs a ContextInfo with the given context path.
|
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addHandler(HTTPServer.ContextHandler handler,
String... methods)
Adds (or replaces) a context handler for the given HTTP methods.
|
Map<String,HTTPServer.ContextHandler> |
getHandlers()
Returns the map of supported HTTP methods and their corresponding handlers.
|
String |
getPath()
Returns the context path.
|
protected final String path
protected final Map<String,HTTPServer.ContextHandler> handlers
public ContextInfo(String path)
path - the context path (without trailing slash)public String getPath()
public Map<String,HTTPServer.ContextHandler> getHandlers()
public void addHandler(HTTPServer.ContextHandler handler, String... methods)
handler - the context handlermethods - the HTTP methods supported by the handler (default is "GET")Copyright © 2021. All rights reserved.