




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、imer);theTimer=setTimeout(turnPage(),speed);checkimer);theTimer=setTimeout(turnPage(),speed);check1.jsp登錄界面Login.jspvtitle用戶登錄界面/titlevformaction=LoginServletmethod=postvbodybgcolor=bluevmarqueedirection=rightonmouseover=stop()onmouseout=start()style=font-family:楷體_GB2312vpvfontsize=10pxcolor=red學(xué)生信
2、息信息管理系統(tǒng)v/fontv/pv/marqueevtablealign=centerwidth=237vtrvtdvtablewidth=100%vtrimer);theTimer=setTimeout(turnPage(),speed);checkimer);theTimer=setTimeout(turnPage(),speed);checkv/divv/trvtrvtdalign=centerSTYLE=cursor:handvfontsize=2vdivclass=b2bbuttonid=bt0onclick=javascript:showPage(0);clearTimeout(t
3、heTimer);theTimer=setTimeout(turnPage(),speed);checkBt();1v/divv/fontv/tdvtdalign=centerSTYLE=cursor:handvfontsize=2vdivclass=b2bbuttonid=bt1onclick=javascript:showPage(1);clearTimeout(theTBt();23v/divvtdalign=centerSTYLE=cursor:handvfontsize=2vdivclass=b2bbuttonid=bt3onclick=javascript:showPage(3);
4、clearTimeout(theTimer);theTimer=setTimeout(turnPage(),speed);checkBt();4v/divv/fontv/tdvtdalign=centerSTYLE=cursor:handvfontsize=2vdivclass=b2bbuttonid=bt4onclick=javascript:showPage(4);clearTimeout(theTonclick=javascript:showPage(4);clearTimeout(theTonclick=javascript:showPage(4);clearTimeout(theTo
5、nclick=javascript:showPage(4);clearTimeout(theTimer);theTimer=setTimeout(turnPage(),speed);checkBt();5v/divvtdalign=centerSTYLE=cursor:handvfontsize=2vdivclass=b2bbuttonid=bt5onclick=javascript:showPage(5);clearTimeout(theTimer);theTimer=setTimeout(turnPage(),speed);checkBt();6v/divv/fontv/tdv/trv/t
6、ablevscriptlanguage=javascriptb2bStr=newArray();b2bStr0=vdivstyle=float:left;width:100%;overflow:hidden;vahref=1giftarget=_blankvimgsrc=1gifwidth=214pxheight=145pxborder=0v/avbrvatarget=_blanktitle=太陽島公園一角href=1gif太陽島公園一角v/av/div;b2bStr1=太陽島公園湖光山色;b2bStr2=哈爾濱雪雕v/div;b2bStr3=vahref=4.giftarget=_blank
7、vimgsrc=4.gifwidth=214pxheight=145pxborder=0v/avbrvatarget=_blanktitle=鏡泊湖href=4.gif鏡泊湖v/av/div;b2bStr4=vdivstyle=float:left;width:100%;overflow:hidden;vahref=5.giftarget=_blankvimgsrc=5.gifwidth=214pxheight=145pxborder=0v/avbrvatarget=_blanktitle=太陽島公園瀑布href=5.gif太陽島公園瀑布v/av/div;b2bStr5=鏡泊湖夜色v/div;
8、varpage=0;varspeed=3000;functionshowPage(id)page=id;setTransition();b2bContentinnerHTML=b2bStrid;b2bContentfiltersrevealTransplay();functionturnPage()showPage(page);theTimer=setTimeout(turnPage(),speed);checkBt();page+;if(page=6)page=0;functioncheckBt()for(vari=0;i6;i+)btObj=eval(bt+i);if(page=i)btO
9、bj.stylecolor=#FFFFFF;btObj.style.backgroundColor=#FF781C;elsebtObj.style.color=#000000;btObj.style.backgroundColor=#F7F7F7;functionsetTransition()b2bContent.filters.revealTrans.Transition=Math.round(Math.random()*23);b2bContent.filters.revealTrans.apply();turnPage();用戶名:密碼:vinputtype=resetvalue=取消v
10、/trv/tablev/formv/bodyv/html2.java代碼(1)User.Java定義的屬性和數(shù)據(jù)庫中的字段相對應(yīng)packagecom.softeem.dt;publicclassUserprivateintid;privateStringusername;privateStringpassword;privateStringxh;privateStringcollege;publicintgetId()returnid;publicvoidsetId(intid)this.id=id;publicStringgetUsername()returnusername;publicv
11、oidsetUsername(Stringusername)this.username=username;publicStringgetPassword()returnpassword;publicvoidsetPassword(Stringpassword)this.password=password;publicStringgetXh()returnxh;publicvoidsetXh(Stringxh)this.xh=xh;publicStringgetCollege()returncollege;publicvoidsetCollege(Stringcollege)this.colle
12、ge=college;(2)UserDA0java操作數(shù)據(jù)庫tb_user,驗(yàn)證用戶登錄packagecom.softeem.dao;importjavasqlConnection;importjava.sql.PreparedStatement;importjava.sql.ResultSet;importjava.sql.SQLException;importcom.softeem.db.DBManager;importcom.softeem.dt.User;publicclassUserDAO/*驗(yàn)證用戶登錄*return*/publicbooleancheckDenglu(Userus
13、er)booleanflag=false;/獲得數(shù)據(jù)庫連接Connectionconn=DBManager.getConnection();/用select*from查詢數(shù)據(jù)庫中的所有字段Stringsql=selectcount(*)fromtb_userwhereusername=?andpassword=?;tryPreparedStatementpst=conn.prepareStatement(sql);pst.setString(1,user.getUsername();pst.setString(2,user.getPassword();/執(zhí)行查詢語句,拿到結(jié)果集ResultSe
14、trs=pst.executeQuery();while(rs.next()intcount=rs.getInt(1);用count和0比較,若大于0表示該用戶存在,否則不存在if(count0)flag=true;catch(SQLExceptione)e.printStackTrace();returnflag;3.LoginServlet,點(diǎn)擊登錄跳轉(zhuǎn)到服務(wù)器端packagecom.softeem.servlet;importjava.io.IOException;importjavax.servlet.ServletException;importjavax.servlet. HYPE
15、RLINK http:/http.HttpServlethttp.HttpServlet;importjavax.servlet. HYPERLINK http:/http.HttpServletRequesthttp.HttpServletRequest;importjavax.servlet. HYPERLINK http:/http.HttpServletResponsehttp.HttpServletResponse;importcom.softeem.dao.UserDAO;importcom.softeem.dto.User;/*Servletimplementationclass
16、LoginServlet*/publicclassLoginServletextendsHttpServletprivatestaticfinallongserialVersionUID=1L;/*seeHttpServlet#HttpServlet()*/publicLoginServlet()super();/*seeHttpServlet#doGet(HttpServletRequestrequest,HttpServletResponseresponse)protectedvoiddoGet(HttpServletRequestrequest,HttpServletResponsere
17、sponse)throwsServletException,IOExceptionsuper.doGet(request,response);/*seeHttpServlet#doPost(HttpServletRequestrequest,HttpServletResponseresponse)*/protectedvoiddoPost(HttpServletRequestrequest,HttpServletResponseresponse)throwsServletException,IOException/獲取表單數(shù)據(jù)/處理亂碼request.setCharacterEncoding(
18、utf-8);Stringusernamerequest.getParameter(username);Stringpasswordrequest.getParameter(password);/封裝到user對象中Useruser=newUser();user.setUsername(username);user.setPassword(password);/調(diào)用dao的checkLogin方法UserDAOdao=newUserDAO();booleanflag=dao.checkLogin(user);Stringmessage=null;Stringpath=null;if(flag)messag
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年度建筑工程安全生產(chǎn)責(zé)任追究合同
- 2025年度外貿(mào)合同書樣本:國際貨物運(yùn)輸保險(xiǎn)合同
- 2025年度商業(yè)地產(chǎn)產(chǎn)權(quán)轉(zhuǎn)讓與物業(yè)管理合同
- 2025年度園林綠化養(yǎng)護(hù)臨時(shí)用工合作協(xié)議
- 二零二五年度移動(dòng)寬帶網(wǎng)絡(luò)用戶滿意度提升合同
- 工業(yè)園區(qū)升級補(bǔ)貼合同
- 2025年度建筑工程合同監(jiān)理實(shí)施辦法
- 2025年度商場顧客滿意度調(diào)查與提升合同
- 2025年度房屋租賃安全免責(zé)合同(帶寵物)
- 2025年導(dǎo)電銀漿行業(yè)現(xiàn)狀分析:導(dǎo)電銀漿市場復(fù)合年增長率為20.12%
- JTT791-2010 公路涵洞通道用波紋鋼管(板)
- JC-T 738-2004水泥強(qiáng)度快速檢驗(yàn)方法
- 山東省春季高考技能考試-汽車專業(yè)必刷必練題庫(600題)
- 人教鄂教版小學(xué)科學(xué)四年級下冊全冊教案
- 2024年黑龍江農(nóng)墾科技職業(yè)學(xué)院高職單招(英語/數(shù)學(xué)/語文)筆試歷年參考題庫含答案解析
- 人民音樂家 教案-2023-2024學(xué)年高中人音版(2019)必修《音樂鑒賞》
- 國家義務(wù)教育質(zhì)量監(jiān)測心理健康和德育測試題
- 絕經(jīng)綜合征(中醫(yī))評定量表
- 揚(yáng)帆藍(lán)天無人機(jī)法律法規(guī)與應(yīng)用培訓(xùn)教案課件
- 工會經(jīng)費(fèi)列支范圍及工會經(jīng)費(fèi)支出范圍
- 成人高考課件
評論
0/150
提交評論