随笔-26  评论-13  文章-46  trackbacks-0
  2005年10月13日

<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 似水流年 阅读(3286) | 评论 (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 似水流年 阅读(1117) | 评论 (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 似水流年 阅读(626) | 评论 (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 似水流年 阅读(416) | 评论 (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 似水流年 阅读(643) | 评论 (0)编辑 收藏