目前分類:java學習心得 (4)

瀏覽方式: 標題列表 簡短摘要
使用Pattern及Matcher判斷字串符不符合各項條件
import java.util.regex.Matcher;
import java.util.regex.Pattern;;

//是否都為數字

momokao 發表在 痞客邦 留言(0) 人氣()

因某人需要國家國旗的資料庫,所以寫了一支簡單的parser,除了PostMethod之外,還可以使用GetMethod,曾遇到過PostMethod抓不了,改用GetMethod就可以
因為只有要抓一次而已,所以寫的很簡略,沒有做太多連線的判斷

需commons-codes.jar、commons-httpclient.jar、commons-io.jar、commons-logging.jar、commons-lang.jar

momokao 發表在 痞客邦 留言(0) 人氣()

檔案資料以二進位型態存至資料庫中,載時,將二進位資料送至瀏覽器下載
class須繼承HttpServlet
String encodedFilename = "test.txt";  //下載的檔名
response.addHeader(
            "Content-Disposition",

momokao 發表在 痞客邦 留言(0) 人氣()

由資料庫抓取資料,製成壓縮檔
需有ant.jar

在Server產生Zip File
import org.apache.tools.zip.ZipEntry;

momokao 發表在 痞客邦 留言(0) 人氣()