国产成人毛片视频|星空传媒久草视频|欧美激情草久视频|久久久久女女|久操超碰在线播放|亚洲强奸一区二区|五月天丁香社区在线|色婷婷成人丁香网|午夜欧美6666|纯肉无码91视频

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(); } } }}

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

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

網(wǎng)友解答:

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

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

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

3、使用jsp編寫html。

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

標(biāo)簽: