public class RootHandler extends Object implements HttpHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_INDEX_FILE_NAME
默认主页文件名
|
| Constructor and Description |
|---|
RootHandler(File rootDir)
构造
|
RootHandler(File rootDir,
String... indexFileNames)
构造
|
RootHandler(String rootDir)
构造
|
RootHandler(String rootDir,
String... indexFileNames)
构造
|
| Modifier and Type | Method and Description |
|---|---|
void |
handle(ServerRequest request,
ServerResponse response)
处理请求
|
public static final String DEFAULT_INDEX_FILE_NAME
public RootHandler(String rootDir)
rootDir - 网页根目录public RootHandler(File rootDir)
rootDir - 网页根目录public RootHandler(String rootDir, String... indexFileNames)
rootDir - 网页根目录indexFileNames - 主页文件名列表public void handle(ServerRequest request, ServerResponse response)
HttpHandlerhandle in interface HttpHandlerrequest - 请求对象response - 响应对象Copyright © 2025. All rights reserved.