<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    隨筆-26  評論-13  文章-46  trackbacks-0
      2005年6月23日

    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=big5">
    </head>

    <body>
    ?<SCRIPT language="javascript">
    ?function next()
    ?? {
    ?? if(event.keyCode==13)event.keyCode=9;
    ? }
    ?</SCRIPT>
    <form name="form1" method="post" action="">
    <input onkeydown="next()" name="text1">
    <input onkeydown="next()" name="text2">
    <input onkeydown="next()" name="text3">
    <input onkeydown="next()" name="text5">
    <input onkeydown="if(event.keyCode==13)event.keyCode=9" name="text4">
    ? <input type="submit" name="Submit" value="Submit">
    ? <input type="reset" name="Submit2" value="Reset">
    </form>
    </body>
    </html>

    posted @ 2006-04-04 13:24 似水流年 閱讀(3300) | 評論 (1)編輯 收藏
         摘要: 以下是摘自http://xdoclet.sourceforge.net/xdoclet/tags/hibernate-tags.html的內容 @hibernate Tag Reference Tags for declaration of Hibernate descriptor file Applies to: All classes, at class level and on get...  閱讀全文
    posted @ 2005-11-15 14:03 似水流年 閱讀(1126) | 評論 (0)編輯 收藏

    一.安裝
       1.安裝jdk1.5,E:\server\jdk1.5
       2.安裝mysql 4.0,E:\server\mysql
       3.安裝Ant 1.6,E:\apache-ant-1.6.2
       4.安裝tomcat5.5,E:\tomcat5

    二.系統路徑的設置:

       1、JAVA_HOME = E:\server\jdk1.5
       2、MYSQL_HOME = E:\server\mysql
       3、ANT_HOME = E:\apache-ant-1.6.2
       4、CATALINA_HOME = E:\tomcat5
       5、path,%JAVA_HOME%\bin;%ANT_HOME%\bin;%CATALINA_HOME%\bin;%MYSQL_HOME%\bin

    三.安裝appfuse-1.8.2,E:\jbproject\appfuse
       1.將..\appfuse\lib\junit3.8.1\junit.jar拷貝到%ANT_HOME%/lib目錄下
       2.根據需要修改build.properties以下部分
         #database.jar=${postgresql.jar}
         #database.type=postgresql
         #database.host=localhost
         #database URL for creating other databases (doesn't work with pgsql)
         #database.admin.url=jdbc:${database.type}://${database.host}/template1
         #database.admin.username=postgres
         #database.admin.password=postgres

         #hibernate.dialect=org.hibernate.dialect.PostgreSQLDialect
         #database.driver_class=org.postgresql.Driver
         #database.url=jdbc:${database.type}://${database.host}/${database.name}

       我只修改了database.admin.password=我的mysql密碼
       3.安裝的可選項,
         如果你希望使用 iBATIS 作為持久化framework, 查看extras/ibatis目錄下的 README.txt 文件或者運行 ant install-ibatis。
         如果你希望使用 Spring 作為web framework, 查看 extras/spring 目錄下的 README.txt 文件或者運行 ant install-springmvc。
         如果你希望使用 WebWork 作為web framework, 查看extras/webwork 目錄下的 README.txt 文件或者運行 ant install-webwork。
         如果你希望使用 JSF 作為web framework, 查看 extras/jsf 目錄下的 README.txt 文件或者運行 ant install-jsf。
         如果你希望使用 Tapestry 作為web framework, 查看 extras/tapestry 目錄下的 README.txt 文件或者運行 ant install-tapestry。

      
    四.新建項目
       1. 在控制臺,E:\jbproject\appfuse>ant new 按照提示輸入application名稱(myapp),database名稱(mydb),package名稱(com.jinn).
       2. 如果package名稱不是org.appfuse,拷貝appfuse下的ApplicationResources_zh_CN.properties和ApplicationResources_zh.properties到對應的路徑下myapp下。(注意如果你的package名稱不是org.appfuse(或不是以org開頭?沒有做過測試),會提示你輸入the first part of your new package,先別忙著
    輸入,看看myapp,跟appfuse一樣,我要你著重看看myapp\web\WEB-INF\classes下的ApplicationResources_zh_CN.properties或ApplicationResources_zh.properties
          跟appfuse下是一樣的。輸入the first part of your new package,例如com,再看看myapp\web\WEB-INF\classes下的ApplicationResources_zh_CN.properties或ApplicationResources_zh.properties
          它的內容變了。原來appfuse在執行rename package的過程中把相關的properties內容做了處理。這會造成頁面顯示亂碼。
       3. 運行E:\jbproject\myapp>ant setup ,BUILD SUCCESSFUL,在瀏覽器輸入http://localhost:8080/myapp。一切正常,此時打開查看${CATALINA_HOME}\webapps\myapp\WEB-INF\classes\ApplicationResources_zh_CN.properties,已被編碼轉換。
       4. 關閉tomcat,運行E:\jbproject\myapp>ant test-all,出錯," failed with message "Wrong document title found! Expected "AppFuse
          ~ ???è?????" but got "AppFuse ~ ???è?????",顯然還是資源文件編碼的問題,注意控制臺有段提示"test with locale 'zh'",將myapp\web\WEB-INF\classes>ApplicationResources_zh.properties更名為ApplicationResources_zh.properties.bak
          運行E:\jbproject\myapp\web\WEB-INF\classes>native2ascii -encoding gbk ApplicationResources_zh.properties ApplicationResources_zh.properties
          再次運行E:\jbproject\myapp>ant test-all BUILD SUCCESSFUL

    參考文章:http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuseQuickStart_zh
     

    posted @ 2005-11-15 11:20 似水流年 閱讀(636) | 評論 (0)編輯 收藏
     

    AppFuseAnt任務

    This page contains a listing of the most common Ant targets in AppFuse that I use in my daily development. For a complete list of tasks, type "ant -projecthelp" at the command line.
    任務
    描述

    setup

    建立database, 配置tomcatdeploys expanded war

    clean

    Removes build artifacts

    compile

    編譯所有的文件

    deploy

    編譯、然后部署到Tomcat

    deploy-web

    部署JSP和靜態Web內容到Tomcat

    install

    使用TomcatManager程序安裝Web程序.
    對于向遠程服務器上部署程序很適合

    list

    列出Tomcat已經安裝、部署好的應用

    refresh

    Undeploys, cleans, 然后重新部署.

    reload

    使Tomcat重新裝載所有程序

    remove

    刪除Tomcat部署好的程序

    setup-db

    創建數據庫,并插入范例需要的數據

    setup-tomcat

    復制JDBC驅動和context.xmlTomcat相應目錄下

    test-all

    運行所有用于測試dao, serviceweb的測試用例

    test-dao

    測試dao模塊

    test-service

    測試service模塊

    test-web

    使用Mocks測試Action/Controller (不需要容器)

    test-jsp

    Tomcat中運行Canoo WebTest (啟動/停止Tomcat, 執行前Tomcat應該被停止)

    test-canoo

    Tomcat已經運行時,執行Canoo WebTest

    test-reports

    產生測試報告

    undeploy

    $CATALINA_HOME/webapps中刪除war文件和相應的目錄

    posted @ 2005-11-11 14:14 似水流年 閱讀(426) | 評論 (0)編輯 收藏

    三個需要的程序包:

    commons-dbcp-1.2.1.jar

    http://apache.linuxforum.net/dist/jakarta/commons/dbcp/binaries/

    struts-legacy.jar

    http://apache.linuxforum.net/dist/jakarta/struts/struts-legacy/

    commons-pool-1.2.jar

    http://apache.linuxforum.net/dist/jakarta/commons/pool/binaries/

    strut-config.xml


      <data-sources>
        <data-source key="mysqlWebDB" type="org.apache.commons.dbcp.BasicDataSource">
          <set-property property="description" value="Mysql DataSource For zyweb" />
          <set-property property="driverClassName" value="org.gjt.mm.mysql.Driver" />
          <set-property property="url" value="jdbc:mysql://localhost:3306/zyweb?useUnicode=true&amp;characterEncoding=GBK" />
          <set-property property="username" value="root" />
          <set-property property="password" value="zyadmin" />
          <set-property property="maxActive" value="10" />
          <set-property property="maxWait" value="5000"/>
          <set-property property="defaultAutoCommit" value="false" />
          <set-property property="defaultReadOnly" value="false"/>
        </data-source>
      </data-sources>

    posted @ 2005-10-13 16:24 似水流年 閱讀(656) | 評論 (0)編輯 收藏
    Java 中對文件的讀寫操作之比較
    一.在 JDK 1.0 中,通常是用 InputStream & OutputStream 這兩個基類來進行讀寫操作的。
    InputStream 中的 FileInputStream 類似一個文件句柄,通過它來對文件進行操作,類似的,在
    OutputStream 中我們有 FileOutputStream 這個對象。

    用FileInputStream 來讀取數據的常用方法是:
    FileInputStream fstream = new FileInputStream(args[0]);
    DataInputStream in = new DataInputStream(fstream);
    用 in.readLine() 來得到數據,然后用 in.close() 關閉輸入流。
    完整代碼見 Example 1。

    用FileOutputStream 來寫入數據的常用方法是:
    FileOutputStream out out = new FileOutputStream("myfile.txt");    
    PrintStream p = new PrintStream( out );
    用 p.println() 來寫入數據,然后用 p.close() 關閉輸入。
    完整代碼見 Example 2。


    二.在 JDK 1.1中,支持兩個新的對象 Reader & Writer, 它們只能用來對文本文件進行操作,而
    JDK1.1中的 InputStream & OutputStream 可以對文本文件或二進制文件進行操作。

    用FileReader 來讀取文件的常用方法是:
    FileReader fr = new FileReader("mydata.txt");
    BufferedReader br = new BufferedReader(fr);
    用 br.readLing() 來讀出數據,然后用br.close() 關閉緩存,用fr.close() 關閉文件。
    完整代碼見 Example 3。

    用 FileWriter 來寫入文件的常用方法是:
    FileWriter fw = new FileWriter("mydata.txt");
    PrintWriter out = new PrintWriter(fw);  
    在用out.print 或 out.println 來往文件中寫入數據,out.print 和 out.println的唯一區別是后者寫
    入數據或會自動開一新行。寫完后要記得 用out.close() 關閉輸出,用fw.close() 關閉文件。   
    完整代碼見 Example 4。

    -------------------------------------------------------------- following is the source code of examples------------------------------------------------------

    Example 1:
    // FileInputDemo
    // Demonstrates FileInputStream and DataInputStream
    import java.io.*;

    class FileInputDemo {
      
    public static void main(String args[]) {
        
    // args.length is equivalent to argc in C
        if (args.length == 1{
          
    try {
            
    // Open the file that is the first command line parameter
            FileInputStream fstream = new FileInputStream(args[0]);
            
    // Convert our input stream to a DataInputStream
            DataInputStream in = new DataInputStream(fstream);
            
    // Continue to read lines while there are still some left to read
            while (in.available() !=0{
              
    // Print file line to screen
              System.out.println (in.readLine());
            }

            
    in.close();
          }
     catch (Exception e) {
            System.err.println(
    "File input error");
          }

        }

        
    else
          System.
    out.println("Invalid parameters");
      }

    }


    Example 2:
    // FileOutputDemo
    // Demonstration of FileOutputStream and PrintStream classes
    import java.io.*;

    class FileOutputDemo 
    {    
      
    public static void main(String args[])  {              
      FileOutputStream 
    out// declare a file output object
        PrintStream p; // declare a print stream object

    try {
      
    // connected to "myfile.txt"
          out = new FileOutputStream("myfile.txt");
          
    // Connect print stream to the output stream
          p = new PrintStream( out );
          p.println (
    "This is written to a file");
          p.close();
        }
     catch (Exception e) {
          System.err.println (
    "Error writing to file");
        }

      }

    }


    Example 3:
    // FileReadTest.java
    // User FileReader in JDK1.1 to read a file 
    import java.io.*;

    class FileReadTest {      
      
    public static void main (String[] args) {
        FileReadTest t 
    = new FileReadTest();
        t.readMyFile();
    }
     
        
      
    void readMyFile() 
        String record 
    = null;
        
    int recCount = 0
        
    try 
    FileReader fr 
    = new FileReader("mydata.txt");
           BufferedReader br 
    = new BufferedReader(fr);
           record 
    = new String();
           
    while ((record = br.readLine()) != null{
             recCount
    ++;
             System.
    out.println(recCount + "" + record); 
    }

    br.close();
    fr.close(); 
         }
     catch (IOException e) 
             System.
    out.println("Uh oh, got an IOException error!");
             e.printStackTrace();
         }

    }
     
      
    }
        

    Example 4:
    // FileWriteTest.java
    // User FileWriter in JDK1.1 to writer a file 
    import java.io.*;

    class FileWriteTest {      
      
    public static void main (String[] args) {
        FileWriteTest t 
    = new FileWriteTest();
        t.WriteMyFile();
    }
     
        
      
    void WriteMyFile() 
        
    try 
    FileWriter fw 
    = new FileWriter("mydata.txt");
    PrintWriter 
    out = new PrintWriter(fw);    
    out.print(“hi,this will be wirte into the file!”);   
    out.close();
    fw.close();
         }
     catch (IOException e) 
             System.
    out.println("Uh oh, got an IOException error!");
             e.printStackTrace();
         }

    }
     
      
    }
        
    posted @ 2005-06-23 17:46 似水流年 閱讀(902) | 評論 (2)編輯 收藏
    主站蜘蛛池模板: 一个人免费观看视频在线中文| 国产婷婷成人久久Av免费高清| 亚洲国产午夜福利在线播放 | 国产精品免费无遮挡无码永久视频| 18gay台湾男同亚洲男同| 成年女人18级毛片毛片免费| 激情吃奶吻胸免费视频xxxx| 久久国产亚洲观看| 日韩一区二区在线免费观看| 华人在线精品免费观看| 亚洲成av人片天堂网无码】| 亚洲AV午夜成人片| 四虎影视永久免费观看| 91在线手机精品免费观看| 黄色毛片免费网站| 亚洲六月丁香六月婷婷蜜芽| 亚洲AV无码成H人在线观看| 国产成人精品免费视频动漫| 国产精品免费大片一区二区| 2020久久精品亚洲热综合一本| 亚洲一区二区三区无码中文字幕 | 亚洲人午夜射精精品日韩| 国产成人精品免费视频网页大全 | 亚洲精品国产精品| 亚洲欧洲日韩不卡| 亚洲国产天堂久久久久久| 99无码人妻一区二区三区免费 | 8x8x华人永久免费视频| 一区二区三区在线观看免费 | 美女被cao网站免费看在线看| 亚洲av永久无码精品秋霞电影秋 | 国产午夜精品免费一区二区三区 | 黄色片免费在线观看| 免费看黄网站在线看| 亚洲国产精品久久久久秋霞小 | 精品亚洲成a人在线观看| 亚洲成人一级电影| 亚洲男人第一av网站| 亚洲精品午夜国产VA久久成人| 又色又污又黄无遮挡的免费视| 四虎永久在线精品免费网址|