【正文】
s helpful to fill in some details on the situation that led to the birth of the technology. Just 10 short years ago, the term thin client was a novelty. We still lived in a world of desktop applications, powered by wimpy 286 microprocessors with 14inch monitors that we squinted at. Boy。t have to be limited to this single technology. In fact, these days a number of presentation technologies are available. This article begins by defining the problems presentation technologies were designed to solve. It then examines the specific strengths and weaknesses of the JSP model. Finally, it introduces some viable alternatives to Sun39。 raw Web content into content wrapped in an attractive presentation layer. JavaServer Pages (JSP) technology, Sun39。s J2EE platform and programming model, serves as a solution to the mon dilemma of how to turn drab content into a visually appealing presentation layer. The fact is, Web developers aren39。我們可以把他們單獨寫成兩個靜態(tài)頁面,然后用 % include file= % % include file = % 將他們包含在每個頁面中??! 4. 英文譯文 每個頁面的上部和下部都是一樣的,都是標題和版權信息。 (AddInfoSQL)。+SaveYHM+39。 } (trtd align=\left\ height=\1\ width=\15%\ colspan=\5\bfont color=\aaCC00\ +總價錢和 +/font/b/tdtd align=\left\ height=\1\ width=\15% \bfont color=\aaCC00\ +ZJQ 信息發(fā)布系統(tǒng) 31 +/font/b/td/tr)。ak。l++) { ZJQ = ZJQ+JQH[l]。 for(int l=0。 int GMZSL=0。 } } } ()。 (trtd align=\left\ height=\1\ width=\15%\bfont color=\FFCC00\ +ZBDH +/font/b/tdtd align=\left\ height=\1\ width=\20% \bfont color=\FFCC00\ +SM +/font/b/tdtd align=\left\ height=\1\ width=\20% 信息發(fā)布系統(tǒng) 30 \bfont color=\FFCC00\ +ZZ +/font/b/tdtd align=\left\ height=\1\ width=\15% \bfont color=\FFCC00\ +JG +/font/b/tdtd align=\left\ height=\1\ width=\15% \bfont color=\FFCC00\ +GMSL +/font/b/tdtd align=\left\ height=\1\ width=\15% \bfont color=\FFCC00\ +JQH[j] +/font/b/td/tr)。 (StrUpDate)。 String StrUpDate = update Book set SL=SL+GMSL+ where ZBDH=39。, +GMSL +,getDate())。,39。 String StrSQL = insert into UserBook (YHM,ZBDH,SL,GMSJ) values (39。 k++。 if (StrSL != null) { int GMSL = (StrSL)。 String StrSL =(String) (ZBDH)。 String SM = (SM)。 int j=0。 信息發(fā)布系統(tǒng) 29 ResultSet rst = (Select ZBDH,SM,ZZ,JG from Book)。 } } } float JQH[]=new float[i]。 if (SL != null) { int GMSL = (SL)。 String SL =(String) (ZBDH)。 int i=0。 以下的代碼用來計算買書的總價錢,以及將買書的信息(買入的圖書編號,買入時間,買入數量等)寫入到數據庫中。這里將計算出買書一共的費用。 信息發(fā)布系統(tǒng) 28 確定無誤后,點擊“提交付款”。買入的書的數量不能超過庫存量。 % 看到中意的書目后 ,點擊“我要買書”,就會打開 BWSD頁面。 } else { (trtd height=\1\ colspan=\4\ /td/tr)。 float JG = (JG)。 String ZZ =(ZZ)。i=20。在打開這個頁面時,將把數據庫中的所有數目信息列在左邊的表格中,一下是用來提取數據庫中信息的代碼,以及ZWM頁面 % ResultSet rs = (select SM,ZZ,CBS,JG from Book)。如果不合法,將再次返回到 Regist頁面從新登錄,如果合法,將打開 。 連接數據庫。 } 用戶填寫完用戶名和密碼之后,點擊“提交”按鈕。amp。 } else { (td align=\Center\ colspan=\2\輸入數據有誤!請重新登錄: /td)。 (?YHM=+YHM+amp。 (input type=\Hidden\ name=\YHM\ value=+YHM+)。+YHM+39。 GLCS++。 信息發(fā)布系統(tǒng) 25 int GLCS = (GLCS)。 ResultSet RQ = (StrSQL1)。 (SavePassword,MM)。 ()。 ()。 (sa,123456,MyDataBase)。 and MM=39。 String StrSQL1 = Select GLCS from Login where YHM=39。 and MM=39。 String StrSQL = Select count(*) as Counter from Login where YHM=39。(! (Lost))) { String YHM = (String) (YHM)。 if ((Param != null)amp。若有錯誤將再次返回到 Regist頁面重新 登錄。 點擊“申請”按鈕后,系統(tǒng)進入 Login0頁面 (如圖所示 ),用戶只需按頁面上的要求正確的填寫注冊信息,然后點擊“確認”,之后會依次進入 Login1, Login2,Login3頁面 ,注冊完成后就可以登陸本站,開始你的網上購書之旅了 ? 信息發(fā)布系統(tǒng) 23 用戶在 Regist頁面進行登錄。 一般來說 Wed應用程序是以 開始的。 } catch(SQLException e) { (())。 Stmt = ()。 } return rs。//得到 Statement對象 rs = (StrSQL)。 } } public ResultSet DbQuery(String StrSQL) { try { 信息發(fā)布系統(tǒng) 22 Conn = (StrURL,Sa,Password)。 try { (ConnDriver)。 Sa = sa。//聲明語句對象 ResultSet rs = null。//連接的數據庫 String ConnDriver = 。//用戶名和密碼 Connection Conn = null。 import .*。 下面給出在本系統(tǒng)中用于連接數據庫,執(zhí)行 SQL語句的 Java源文件: package MyBook。它將跳過代碼不可信任的驅動程序,除非加載它們的源與試圖打開連接的代碼的源相同。在這種情況下,測試驅動程序的順序至關重要,因為 DriverManager 將使用它所找到的第一個可以成功連接到給定 URL 的驅動程序。 信息發(fā)布系統(tǒng) 21 有時可能有多個 JDBC 驅動程序可以與給定的 URL 連接。 2.