dwr目前支持DWREngine.XMLHttpRequest ,DWREngine.IFrame = 2;DWREngine.ScriptTag = 3;
其中
?? DWREngine.XMLHttpRequest 是ajax方式;
?? DWREngine.IFrame是在activex被禁用時使用的方式;
? DWREngine.ScriptTag 是在跨域調用時使用的方式。
我在使用DWREngine.ScriptTag 方式時遇到一個問題,出現錯誤“please specify scriptTagBase property”.
如果有朋友知道解決的辦法,請告訴我,不勝感激!
一、下載appfuse并解壓
二、下載ant1.6.5并解壓
三、下載并安裝tomcat5.0+
如果數據庫放在本機請更改tomcat的監聽端口(因為oracle的tnslistner的監聽端口為8080,
會引起端口沖突!)
四、設置環境變量
1、jdk:JAVA_HOME=
2、tomcat :CATALINA_HOME=
3、ant :ANT_HOME
五、 oracle
1、創建用戶
CREATE USER appftest IDENTIFIED BY appftest;
GRANT CONNECT TO appftest;
GRANT RESOURCE TO appftest;
2、oracle jdbc driver
copy ojdbc14.jar to {AppFuse home}/lib directory
3、在{appfuse path}/build.properties中加入下面屬性
database.jar=${lib.dir}/oracle/ojdbc14.jar
database.type=oracle
database.host=localhost
#use the database schema owner and password created in step #1 above here
database.username=appfuse
database.password=appfuse
hibernate.dialect=net.sf.hibernate.dialect.Oracle9Dialect
database.driver_class=oracle.jdbc.driver.OracleDriver
database.url=jdbc:oracle:thin:@localhost:1521:oracledb
六、修改 web/WEB-INF/classes/mail.properties
七、生成應用
cd {appfuse path}
ant new -Dapp.name=myappname -Ddb.name=appftest
cd ..\myappname
ant setup
八、檢驗
啟動tomcat
在瀏覽器敲入url:http://localhost:port/myappname檢驗是否成功!
好了,一切都完成了,祝你好運!
數據庫的表中存放樹形數據最常用的方式是tb_dept(dept_id,dept_name,parent_id),查詢某個部門的所有子部門,并把結
果組織成樹形結構是我們經常需要解決的一個問題,oracle提供了查詢樹形數據的語法。他可以查詢數中某個節點的所有子節點,結果級按展開一個樹的順序
出現,并且可以列出某節點所處的層,便于我們處理數據,示例如下:
drop table test_dept;
create table test_dept
(dept_id varchar2(20),dept_name varchar2(40),parent_id varchar2(20));
insert into test_dept values ('0','dept1',null);
insert into test_dept values ('1','dept11','0');
insert into test_dept values ('11','dept11','1');
insert into test_dept values ('12','dept12','1');
insert into test_dept values ('2','dept2','0');
insert into test_dept values ('21','dept21','2');
insert into test_dept values ('211','dept211','21');
insert into test_dept values ('212','dept212','21');
insert into test_dept values ('22','dept22','2');
select dept_id,dept_name,level
from test_dept
start with dept_id='0'
connect by prior dept_id=parent_id;
結果如下:
DEPT_ID
DEPT_NAME
LEVEL
-------------------- ---------------------------------------- ----------
0
dept1
1
1
dept11
2
11
dept11
3
12
dept12
3
2
dept2
2
21
dept21
3
211
dept211
4
212
dept212
4
22
dept22
3
9 rows selected