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

📄 rmiasp.java

📁 自己写的一个struts+spring+hibernate测试程序
💻 JAVA
字号:
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.net.*;
import java.net.URL;
import java.util.List;


/*
 * Created on 2005-12-20
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */

/**
 * @author Administrator
 *
 * TODO To change the template for this generated type comment go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
public class RmiASP {

	public static void main(String[] args) {
		 List list=null;
	}
	public void test(){
		URL myURL = null;
		HttpURLConnection conn = null;
		BufferedReader reader = null;
		String urlString="";
		try {
			myURL = new URL(urlString); // urlString defined elsewhere
			conn=(HttpURLConnection) myURL.openConnection();
			//conn = new HttpURLConnection(myURL);
			//new HttpURLConnection()
			conn.connect();
			System.out.println("conn.getAllowUserInteraction()" +conn.getAllowUserInteraction());
			
			System.out.println("conn.getRequestMethod(): "+conn.getRequestMethod());
			
			System.out.println("conn.getResponseMessage(): "+conn.getResponseMessage());
			
			
			reader = new BufferedReader(new InputStreamReader(conn
					.getInputStream()));
			String line;
			while ((line = reader.readLine()) != null) {
				// Do something with output...       
				System.out.println(line + "\n");
			}
			reader.close();
			reader = null;
		} catch (Exception e) {
			System.out.println(this.getClass().getName()
					+ ": problem getting content from " + myURL.toString());
			e.printStackTrace();
		} finally {
			conn.disconnect();
		}
	}
}

⌨️ 快捷键说明

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