almost 5 years ago

報表難免跑不掉需要使用到中文字的地方,但是你可能會遇到在iReport Designer看起來好好的,但是打包出來執行卻看不到中文字,這時候你需要將字型另外打包。

Read on →
 
almost 5 years ago

此篇採用Java Bean做為資料來源,相較於直接下SQL產出報表的做法慢,但優點為彈性較大,再難的資料結構你都可以組合好再送出去產生報表。

Read on →
 
about 5 years ago

有 ContentLength 的寫法

public void Writeoff(HttpServletRequest request, HttpServletResponse response) throws Exception{
  ServletInputStream inStream = request.getInputStream(); //取HTTP請求流

  int size = request.getContentLength(); //取HTTP請求流長度

  byte[] buffer = new byte[size];
  inStream.read(buffer); //讀取buffer長度的資料,存在buffer,並回傳其長度

  String alldata = new String(buffer, "big5");
  //alldata 就是request帶來的所有資料,內容要自己分析

}
 
about 5 years ago
    Path file = null;
    BufferedWriter bufferedWriter  = null;
    try{
        file = Files.createFile(Paths.get("D:\\SimpleNIOData.txt"));

        String line = "I am writing using NIO.鑫峯";
        bufferedWriter = Files.newBufferedWriter(file, Charset.forName("UTF-8"));
        bufferedWriter.write(line);
        bufferedWriter.flush();
        bufferedWriter.close();

    }catch(IOException e){
        e.printStackTrace();
    }finally{
        try{
            bufferedWriter.close();
        }catch(IOException ioe){
            ioe.printStackTrace();
        }
    }
 
about 5 years ago
HashMap map = new HashMap();
Iterator it = map.keySet().iterator();
        for(int i = 0 ; i < map.size() ; i++ ){
             String key = (String)it.next();
             System.out.println("原始資料 : key="+key+" value="+payMap.get(key));
        }
 
about 5 years ago

JAVA有個判斷用繼承關係方法instanceof 如下

public isParent(Object object){
     if(object instanceof ArrayList){
          //object!你老爸是ArrayList啦!

     } else{
          //object!你老爸不是ArrayList,別亂認老爸!!!!

     }
}
Read on →
 
about 5 years ago

因專案需求必須以webservice訪問客戶的資料,所以導入使用。

本次採用的是Apache Axis2/Java方式,
官網:http://axis.apache.org/axis2/java/core/index.html
版本:axis2-1.6.0
檔案:http://apache.cdpa.nsysu.edu.tw//axis/axis2/java/core/1.6.0/axis2-1.6.0-bin.zip

Read on →
 
about 5 years ago

整合spring跟log4j很方便

Read on →
 
about 5 years ago

目前是使用gitblit,原因是簡單方便。

直接下載Gitblit WAR,放在tomcat解壓佈署完成後就可以進行帳號及管理動作。

只是部分功能看起來有點問題,但不影響主要程式的上傳。

 
about 5 years ago
Command Description
init 0 shutdown system
logout leaving session
reboot reboot
shutdown -h now shutdown system
shutdown -h 16:30 & planned shutdown of the system
shutdown -c cancel a planned shutdown of the system
shutdown -r now reboot
telinit 0 shutdown system
halt For shutdown system