mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix code
This commit is contained in:
@@ -3,6 +3,8 @@ package cn.hutool.http.server.action;
|
||||
import cn.hutool.http.server.HttpServerRequest;
|
||||
import cn.hutool.http.server.HttpServerResponse;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* 请求处理接口<br>
|
||||
* 当用户请求某个Path,则调用相应Action的doAction方法
|
||||
@@ -18,5 +20,5 @@ public interface Action {
|
||||
* @param request 请求对象
|
||||
* @param response 响应对象
|
||||
*/
|
||||
void doAction(HttpServerRequest request, HttpServerResponse response);
|
||||
void doAction(HttpServerRequest request, HttpServerResponse response) throws IOException;
|
||||
}
|
||||
|
@@ -6,6 +6,8 @@ import cn.hutool.http.server.action.Action;
|
||||
import com.sun.net.httpserver.HttpExchange;
|
||||
import com.sun.net.httpserver.HttpHandler;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Action处理器,用于将HttpHandler转换为Action形式
|
||||
*
|
||||
@@ -26,7 +28,7 @@ public class ActionHandler implements HttpHandler {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handle(HttpExchange httpExchange) {
|
||||
public void handle(HttpExchange httpExchange) throws IOException {
|
||||
action.doAction(
|
||||
new HttpServerRequest(httpExchange),
|
||||
new HttpServerResponse(httpExchange)
|
||||
|
Reference in New Issue
Block a user