Package | Description |
---|---|
org.dromara.hutool.http.server.engine |
HTTP服务器引擎包
|
org.dromara.hutool.http.server.engine.jetty |
Jetty9引擎实现
|
org.dromara.hutool.http.server.engine.sun |
HttpServer 引擎实现包 |
org.dromara.hutool.http.server.handler |
HTTP服务器请求和响应处理器的统一封装
|
Modifier and Type | Field and Description |
---|---|
protected HttpHandler |
AbstractServerEngine.handler |
Modifier and Type | Method and Description |
---|---|
ServerEngine |
ServerEngine.setHandler(HttpHandler handler)
设置请求处理器
|
AbstractServerEngine |
AbstractServerEngine.setHandler(HttpHandler handler) |
Constructor and Description |
---|
Jetty9Handler(HttpHandler handler)
构造
|
Modifier and Type | Method and Description |
---|---|
SimpleServer |
SimpleServer.addAction(String path,
HttpHandler action)
增加请求处理规则,使用默认的
RootHandler ,默认从当前项目根目录读取页面 |
Modifier and Type | Class and Description |
---|---|
class |
RootHandler
默认的处理器,通过解析用户传入的path,找到网页根目录下对应文件后返回
|
class |
RouteHttpHandler
路由处理器
根据请求的路径精确匹配路由,并调用对应的处理器,如果没有定义处理器,使用默认处理器 |
Modifier and Type | Method and Description |
---|---|
HttpHandler |
PathTrie.match(String path)
查找匹配的处理器,采用最长匹配模式,即:
传入"a/b/c",存在"a/b/c",则直接匹配,否则匹配"a/b",否则匹配"a" |
Modifier and Type | Method and Description |
---|---|
void |
PathTrie.add(String path,
HttpHandler handler)
添加路由
|
static RouteHttpHandler |
RouteHttpHandler.of(HttpHandler defaultHandler)
创建路由处理器
|
RouteHttpHandler |
RouteHttpHandler.route(String path,
HttpHandler handler)
添加路由
|
Constructor and Description |
---|
RouteHttpHandler(HttpHandler defaultHandler)
构造
|
Copyright © 2025. All rights reserved.