⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 helloclient.java

📁 Java的面向对象数据库系统的源代码
💻 JAVA
字号:
package cli;import java.io.*;import java.net.HttpURLConnection;import java.net.URL;public class HelloClient {    public static void main(String[] args) {        try {            callServlet();        } catch (Exception e) {            e.printStackTrace();        }    }    private static void callServlet() throws IOException {        URL url = new URL("http", "localhost", 80, "/SimpleOzoneServlet/HelloServlet");        System.out.println("Connecting to " + url);        HttpURLConnection connection = (HttpURLConnection) url.openConnection();        BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream()));        String response = reader.readLine();        do {            System.out.println(response);            response = reader.readLine();        } while (response != null);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -