📄 helloserver.java
字号:
package temp; //服务器程序将创建的管理器注册到服务器上, //并为服务器指明应用程序其他特定的参数。 //服务器类 import org.apache.xmlrpc.WebServer; import org.apache.xmlrpc.XmlRpc; import java.io.IOException; public class HelloServer { public static void main(String[] args){ // if(args.length<1){ // System.out.println("Usage: java HelloServer [port]"); // System.exit(-1); // } try{ XmlRpc.setDriver("org.apache.xerces.parsers.SAXParser"); //start the server System.out.println("Starting XML-RPC Server......"); WebServer server = new WebServer(Integer.parseInt("8585")); //register our handler class server.addHandler("hello", new HelloHandler()); System.out.println("Now accepting requests......"); }catch(ClassNotFoundException e){ System.out.println("Could not locate SAX Driver"); } catch(Exception ex){ System.out.println("Could not start server: "+ex.getMessage()); } } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -