卖逼视频免费看片|狼人就干网中文字慕|成人av影院导航|人妻少妇精品无码专区二区妖婧|亚洲丝袜视频玖玖|一区二区免费中文|日本高清无码一区|国产91无码小说|国产黄片子视频91sese日韩|免费高清无码成人网站入口

Java中怎么寫HTML?

網(wǎng)友解答: package com.claridy.common;import java.io.BufferedReader;import java.io.InputStreamRead

網(wǎng)友解答:

package com.claridy.common;import java.io.BufferedReader;import java.io.InputStreamReader;import java.net.HttpURLConnection;import java.net.URL;public class Test { public void testMain() throws Exception{ StringBuffer response = new StringBuffer(); HttpURLConnection connection = null; try { URL url = new URL("http://……"); connection = (HttpURLConnection) url.openConnection(); connection.connect(); BufferedReader reader = new BufferedReader(new InputStreamReader(connection.getInputStream())); String lines; while((lines = reader.readLine()) != null) { if(lines != null && lines.trim().length() 0) { response.append(lines.trim()); } else { continue; } } System.out.println(response.toString()); reader.close(); } catch(Exception e) { throw e; } finally { if(connection != null) { connection.disconnect(); } } }}

上面是 源碼,這個(gè)比較簡單,下面是圖片顯示:

請大家多多關(guān)注我的酷米號,謝謝大家!

網(wǎng)友解答:

java web中編寫html常見的方法:

1、直接編寫靜態(tài)的html文件,不具備動(dòng)態(tài)功能。

2、直接拼接html字符串,在servlet中使用response的輸出流輸出。

3、使用jsp編寫html。

4、使用模板引擎編寫html,常見的如velocity,freemarker等。

標(biāo)簽: