J2EE tutorial 實例安裝

- 中國WEB開發者網絡 (http://www.webasp.net)
-- 技術教程 (http://www.webasp.net/article/)
--- J2EE tutorial 實例安裝 (http://www.webasp.net/article/23/22093.htm)
-- 作者:未知
-- 發佈日期: 2005-04-30

本節介紹各個代表性實例的安裝,原英文介紹文檔位於以下路徑:J2EE1.4/samples/docs/list.html

 



Duke’s Bookstore



1 編譯。

切換到J2EE1.4 amples\webapps\bookstore\bookstore1 rc

1) 執行 asant clean.,這是清除



2) 執行 asant core,這是編譯

 



2 啟動PointBase數據庫,並準備數據



1) 執行<pointbase_install_dir>/tools/serveroption/startserver.bat 腳本

2) 啟動Server



3) 切換到J2EE1.4 amples\webapps\bookstore\bookstore1 rc,運行:

asant deploy



 



3 運行



在瀏覽器鍵入:http://<host>:<port>/bookstore1/enter



 



4 生成javadoc



在J2EE1.4 amples\webapps\bookstore\bookstore1 rc下運行:

asant javadocs



 



Stateless SessionBean



Location: J2EE1.4 amples/ejb/stateless/simple/src



 



Stateful SessionBean-CartBean

Location: D:\Devs\J2EE1.4 amples\ejb tateful imple rc

Run:



cd <install_dir>/domains/<domain_name>/applications/j2ee-apps/stateful-simple/



run : appclient -client stateful-simpleClient.jar -name CartClient –textauth



 



CMP Customer



Location: D:\Devs\J2EE1.4 amples\ejb\cmp\cmpcustomer rc

1 在控制台建立jdbc連接資源,名稱為:jdbc/cmpcustomer



2 創建連接池:cmpcustomer-pool



Run: http://localhost:8080/customer/



 



StorageBin (bmp-Simple) Application



Location: D:\Devs\J2EE1.4 amples\ejb\bmp imple rc



How to Run:



In: D:\Devs\J2EE1.4\domains\domain1\applications\j2ee-apps\bmp-simple



Run:



appclient -client bmp-simpleClient.jar -name StorageBinClient -textauth



 



MDB

Location: D:\Devs\J2EE1.4 amples\ejb\mdb imple rc

 



定義資源

1 登陸Server,在Java Message Service 處點擊Connection Factories,然後選擇New



2 輸入:



JNDI-Name: jms/MyQcf Type: javax.jms.QueueConnectionFactory Resource: Select Enabled checkbox



3 點擊 Destination Resources 點 New,輸入:



JNDI-Name: jms/MyQueue Type: javax.jms.Queue Resource: Select Enabled checkbox



 



4 運行:



in :D:\Devs\J2EE1.4\domains\domain1\applications\j2ee-apps\mdb-simple



run



appclient -client mdb-simpleClient.jar -name SimpleMessageClient –textauth -xml D:\Devs\J2EE1.4\domains\domain1\config un-acc.xml



 



  



已安裝實例和運行路徑如下:

Name



URL



Duke’s Bookstore

http://localhost:8080/bookstore1/enter



Stateless SessionBean

http://localhost:8080/helloworld



Stateful

D:\Devs\J2EE1.4\domains\domain1\applications\j2ee-apps tateful-simple



 



appclient -client stateful-simpleClient.jar -name CartClient –textauth



CMP

http://localhost:8080/customer/



BMP

D:\Devs\J2EE1.4\domains\domain1\applications\j2ee-apps\bmp-simple



 



appclient -client bmp-simpleClient.jar -name StorageBinClient -textauth



MDB

D:\Devs\J2EE1.4\domains\domain1\applications\j2ee-apps\mdb-simple



 



appclient -client mdb-simpleClient.jar -name SimpleMessageClient –textauth -xml D:\Devs\J2EE1.4\domains\domain1\config un-acc.xml



webasp.net