解决server API发送消息返回结果为空的问题

This commit is contained in:
heavyrain lee
2019-05-01 23:49:11 +08:00
parent ce16f87e12
commit 025af5eae0
29 changed files with 84 additions and 57 deletions
@@ -27,7 +27,8 @@ public class NotFoundAction extends Action{
private final static String TEMPLATE_ERROR = "<!DOCTYPE html><html><head><title>LoServer - Error report</title><style>h1,h3 {color:white; background-color: gray;}</style></head><body><h1>HTTP Status {} - {}</h1><hr size=\"1\" noshade=\"noshade\" /><p>{}</p><hr size=\"1\" noshade=\"noshade\" /><h3>LoServer</h3></body></html>";
@Override
public void action(Request request, Response response) {
public boolean action(Request request, Response response) {
response.sendError(HttpResponseStatus.NOT_FOUND, "404 Not found!");
return true;
}
}