📄 lottoserver.java
字号:
import java.io.*;
import nu.xom.*;
import org.apache.xmlrpc.*;
public class LottoServer {
int port = 4404;
WebServer server;
public LottoServer() throws IOException, ParsingException {
// create the server
System.out.println("Creating server on port " + port);
server = new WebServer(port);
// register the request handler
LottoCounter counter = new LottoCounter();
server.addHandler("lotto", counter);
}
public void start() {
// start the server
System.out.println("Now accepting requests");
server.start();
}
public static void main(String[] arguments) {
try {
LottoServer lotto = new LottoServer();
lotto.start();
} catch (Exception exception) {
System.out.println("Error: " + exception.getMessage());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -