




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、基于JSP的個(gè)人主頁的設(shè)計(jì)與實(shí)現(xiàn) 院 系 經(jīng)濟(jì)與管理學(xué)院 專 業(yè) 信息管理與信息系統(tǒng) 學(xué) 號(hào) 06111027 學(xué)生姓名 李凱麗 基于JSP的個(gè)人主頁的設(shè)計(jì)與實(shí)現(xiàn) 一 實(shí)驗(yàn)要求使用jsp語言制作一個(gè)個(gè)人主頁網(wǎng)站,網(wǎng)站要能實(shí)現(xiàn)登錄和注冊(cè)功能,并連接數(shù)據(jù)庫。二實(shí)驗(yàn)?zāi)康?.掌握HTML語言和JSP語言,能用其制作網(wǎng)頁并實(shí)現(xiàn)與數(shù)據(jù)庫連接的功能;2.掌握數(shù)據(jù)庫的基本操作,實(shí)現(xiàn)創(chuàng)建、插入、查詢等功能;3.形成建立網(wǎng)站的思維架構(gòu),明確網(wǎng)站的功能及組成部分。三環(huán)境要求1. Windows 7(操作系統(tǒng));2. Microsoft Office Access 2007(數(shù)據(jù)庫);3. Dreamweaver (
2、專業(yè)網(wǎng)頁制作工具);4. 360安全瀏覽器;5. Tomcat 7.0(jsp服務(wù)器);6. JDK (Java 語言的軟件開發(fā)工具包)。四設(shè)計(jì)內(nèi)容4.1服務(wù)器的配置第一步:從官方網(wǎng)站http;/下載該軟件的最新版本。我所下載的是jdk-8u25-windows-x64文件。第二步:雙擊.exe文件第三步:JDK的環(huán)境配置:在Windows中用鼠標(biāo)指向我的電腦,按右鍵,選擇“屬性”,在“系統(tǒng)特性”表單內(nèi)選擇“高級(jí)”標(biāo)簽,在“高級(jí)”標(biāo)簽內(nèi)選擇“環(huán)境變量”,在系統(tǒng)變量中加入變量JAVA_HOME變量:C:ProgramFilesJavajdk1.8.0Classpath變量為.;%JAVA_HOM
3、E%libdt.jar;%JAVA_HOME%libtools.jar,path變量值為C:Program FilesJavajdk安裝和配置完畢后,在“命令提示符”中輸入javac,會(huì)出現(xiàn)如圖1所示,則說明JDK安裝和配置都是正確的 4.2 Tomcat安裝及配置直接運(yùn)行下載的apache-tomcat-7.0.57文件,按照一般的Windows程序安裝步驟即可安裝好Tomcat,安裝時(shí)它會(huì)自動(dòng)尋找JDK的位置。安裝過程中需要選擇一個(gè)文件夾作為Tomcat的安裝目錄。我選擇安裝的位置是D:JAVAtomcat安裝完成以后,添加一個(gè)Tomcat的環(huán)境變量,添加方法和JDK的環(huán)境變量的添加方法相
4、同,設(shè)置變量名為TOMCAT_HOME,變量值為D:JAVAtomcat設(shè)置完畢后就可以運(yùn)行Tomcat服務(wù)器了。Tomcat成功啟動(dòng)后,在瀏覽器中輸入http;/localhost;8080/,如果出現(xiàn)歡迎界面,則說明Tomcat安裝成功。歡迎界面如圖2 五、數(shù)據(jù)庫分析及總體設(shè)計(jì)5.1 數(shù)據(jù)庫需求分析 整個(gè)系統(tǒng)功能需要以下數(shù)據(jù)項(xiàng):用戶:name、password、email5.2 數(shù)據(jù)庫結(jié)構(gòu)設(shè)計(jì) 用JSP連接數(shù)據(jù)庫,關(guān)鍵代碼如下<%if(request.getParameter("name")!=null&&request.getParameter(
5、"password")!=null)Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");Connection con=DriverManager.getConnection("jdbc:odbc:kiali");Statement smt=con.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.CONCUR_READ_ONLY);String getpaperdata="SELECT * FROM kaili WH
6、ERE name='"+request.getParameter("name")+"'AND password='"+request.getParameter("password")+"'"ResultSet papers=smt.executeQuery(getpaperdata);if(papers.next()response.sendRedirect("denglu_yes.jsp");else out.println("密碼賬號(hào)不符!
7、");%>六、程序運(yùn)行(1)登錄注冊(cè)界面 <!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="/1999/xhtml"><head><meta http-equiv="Content-Type" content="
8、;text/html; charset=windows-1252" /><title>Book Store</title> </head><body ><p> </p><table width="120%" align="center"> <tr> <td height="211"><img src="pic/2.jpg" width="1024" height=&q
9、uot;476" /></td> </tr> <tr> <td>歡迎進(jìn)入個(gè)人主頁</td> </tr> <tr> <td > <table width="60%" align="center" > <tr> <td width="50%" align="center"><a href="denglu.jsp">登陸</a>&l
10、t;/a></td> <td width="50%" align="center"></a><a href="zhuce.jsp">注冊(cè)</a></td> </tr> </table> <p> </p></td> </tr> </table></body></html> (2)用戶注冊(cè) <% page contentType="text
11、/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %><!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="/1999/xht
12、ml" xmlns:ice="<head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>注冊(cè)</title><script src="includes/ice/ice.js" type="text/javascript"></script></head> <body bgcolor="#FFF
13、FCC" > <tr > <td height="27" align="center"><p> </p> <p align="center">新用戶注冊(cè)</p> <hr /></td> </tr> <form name="form123" method="post" action="zhuce_yes.jsp" > <p align=&
14、quot;center">用戶: <input type="text" name="name" value=""> </p> <p align="center">密碼 : <input type="password" name="password" value=""></p> <p align="center">確認(rèn) : <input type
15、="password" name="password1" value=""></p> <p align="center">郵箱 : <input type="text" name="email" value=""> </p> <p align="center"> <input type="submit" name="button&quo
16、t; id="button" value="提交" /></p></form></body></html>(3) 注冊(cè)成功 <% page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %><!DOCTYPE html PUBLIC "-/W3C/DTD XHTML
17、1.0 Transitional/EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>無標(biāo)題文檔</title></he
18、ad> <body > <% try Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");catch(ClassNotFoundException e)try Connection con=DriverManager.getConnection("jdbc:odbc:kaili","",""); Statement stmt=con.createStatement();String adddata="INSERT INTO kaili&quo
19、t;+"(name,password,password1,email)"+"values"+"("+ "'"+request.getParameter("name")+"',"+ "'"+request.getParameter("password")+"',"+ "'"+request.getParameter("password1")
20、+"',"+ "'"+request.getParameter("email")+"'"+")" stmt.execute(adddata); catch(SQLException e) %><p align="center">注冊(cè)成功,歡迎進(jìn)入個(gè)人主頁!</p> <p>美圖收藏 </p><p align="center"><img src="pic/
21、1011259964f87bc9b3.jpg" width="245" height="200" /><img src="pic/12568172069925.jpg" width="245" height="200" /></p><p align="center"><img src="pic/11292899927f1365dam.jpg" width="245" height
22、="200" /><img src="pic/12604112121802.jpg" width="245" height="200" /></p><p> </p> </body></html>(4) 登錄 <% page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" e
23、rrorPage="" %><!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="/1999/xhtml"><head><meta http-equiv="Content-Type" content="t
24、ext/html; charset=utf-8" /><title>無標(biāo)題文檔</title></head> <body bgcolor="#FFFFCC"><p><form name="formabc" action="denglu_action.jsp" method="post"></p><p align="center">用戶登錄</p><hr />&l
25、t;table align="center"width="283" border="0"> <tr> <td class="font"width="295" height="45">用 戶: <input type="text" name="name" id="name"></td> </tr> <tr> <td class=&quo
26、t;font" height="45">密 碼: <input type="password" name="password" id="password"></td> </tr> <tr> <td height="45"> <input type="submit" value="登錄"> </tr></table></body></html>(5)登陸成功 <% page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %><!DOCTYPE html PUBLIC "-/W3C/DTD XHTML 1.0 Transitional/EN" "/TR/xhtml1/DTD/xhtml1-transi
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 預(yù)防中暑主題班會(huì)課件
- 預(yù)制廠安全教育課件
- 大學(xué)誠信文明主題教育
- 公務(wù)接待培訓(xùn)
- 項(xiàng)痹中醫(yī)診療課件
- 鋼筆畫技能培訓(xùn)課件視頻
- 健康飲食產(chǎn)業(yè)園項(xiàng)目環(huán)境影響報(bào)告書
- 2025年核設(shè)施退役技術(shù)設(shè)備項(xiàng)目建議書
- xx片區(qū)城鄉(xiāng)供水一體化項(xiàng)目投資計(jì)劃書(模板范文)
- 2025年工業(yè)爐窯的新型燃燒裝置項(xiàng)目建議書
- 2025年電工證考試試題及答案
- 軍人心理健康教育教案
- 新成立傳媒公司策劃方案
- 2025年吉林省中考數(shù)學(xué)試卷真題及答案詳解(精校打印版)
- 螺旋溜槽安裝標(biāo)準(zhǔn)工藝
- 2022年人教版六年級(jí)下冊(cè)語文期末考試卷
- 《土地開發(fā)整理項(xiàng)目預(yù)算編制暫行辦法》
- 智能家居設(shè)備產(chǎn)業(yè)提質(zhì)增效行動(dòng)方案(參考意見稿)
- 安徽省評(píng)議公告的中小學(xué)教輔材料零售價(jià)格表
- 德龍自卸車合格證掃描件(原圖)
- 西子otis梯oh con6423中文調(diào)試手冊(cè)
評(píng)論
0/150
提交評(píng)論