![藥品進(jìn)銷存儲管理系統(tǒng)(二)_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/1/45b90374-23e0-4fa6-b2db-2543e6fb1d98/45b90374-23e0-4fa6-b2db-2543e6fb1d981.gif)
![藥品進(jìn)銷存儲管理系統(tǒng)(二)_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/1/45b90374-23e0-4fa6-b2db-2543e6fb1d98/45b90374-23e0-4fa6-b2db-2543e6fb1d982.gif)
![藥品進(jìn)銷存儲管理系統(tǒng)(二)_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/1/45b90374-23e0-4fa6-b2db-2543e6fb1d98/45b90374-23e0-4fa6-b2db-2543e6fb1d983.gif)
![藥品進(jìn)銷存儲管理系統(tǒng)(二)_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/1/45b90374-23e0-4fa6-b2db-2543e6fb1d98/45b90374-23e0-4fa6-b2db-2543e6fb1d984.gif)
![藥品進(jìn)銷存儲管理系統(tǒng)(二)_第5頁](http://file3.renrendoc.com/fileroot_temp3/2022-3/1/45b90374-23e0-4fa6-b2db-2543e6fb1d98/45b90374-23e0-4fa6-b2db-2543e6fb1d985.gif)
下載本文檔
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、藥品進(jìn)銷存儲管理系統(tǒng)(二) 09-05-24 09:37:00 作者:未知 編輯:studa090420按照下述內(nèi)容設(shè)計(jì)register.jsp文件。表單名:form1。表單執(zhí)行程序:register.jsp。表單數(shù)據(jù)傳輸方法:post。表單的要素如附錄一表1所示。在structs-config.xml中actionMappings中配置如下:<action input="/register
2、.jsp" name="RegisterForm" path="/register" <forward name="register.ok" path="/index.jsp"/> <forward name="register.error&
3、quot; path="/register.jsp"/> </action>/帶表單驗(yàn)證類的action,input參數(shù)為表單證錯誤返回的頁面,name是接受頁面參數(shù)的表單類,path為頁面請求到服務(wù)器的路徑,type為處理請求的action類的路徑,forward為驗(yàn)證成功與否的轉(zhuǎn)發(fā)路徑。RegisterAction.java代碼如下:package my.action;public class RegisterAction extends Action p
4、ublic ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) UserBean user = new UserBean();/聲明JavaBean
5、; RegisterForm rform = (RegisterForm) form;/從表單類中接過已驗(yàn)證過的表單信息 user.setUsername(rform.getUsername(); user.setPassword(rform.getPassword(); user.setSex(rform.getSex();
6、0; user.setBorntime(rform.getYear() + "-" + rform.getMonth() + "-" + rform.getDay(); user.setEmail(rform.getEmail();
7、160; user.setIntroduce(rform.getIntroduce(); user.setRealname(rform.getRealname(); user.setTelNumber(rform.getTelNumber(); user.setStatus("0");/賦值Bean中所有屬性
8、60; UserBean database=new UserDAO().findOne(user.getUsername();/注冊之前檢查用戶名是否已經(jīng)存在,若存在則生成錯誤信息,反饋到注冊頁面 if(database!=null) request.setAttribute("login.error", "對不起,您的用戶名已經(jīng)被人使用,請重新輸入!"
9、); return mapping.findForward("register.error"); /所有驗(yàn)證完成,將用戶信息入庫,成功則將成功信息反饋到首頁 int n = new UserDAO().insertUser(user);
10、0; if (n = 0) return mapping.findForward("register.error"); else request.setAttribute("login.error", "注冊成功,請等待審核!&quo
11、t;); return mapping.findForward("register.ok"); 圖4-2 用戶活動過程在structs-config.xml中actionMappings中配置如下:<action input="/index.jsp" name="LoginForm" path=&quo
12、t;/login" <forward name="login.ok" path="/user_index.jsp"/> <forward name="login.error" path="/index.jsp"/>
13、0; </action>其中模塊商業(yè)邏輯的主要部分LoginAction.java的代碼如下:package my.action;public class LoginAction extends Action public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, H
14、ttpServletResponse response) LoginForm userform=(LoginForm)form;/獲取頁面表單信息 UserBean bean=null; bean=new UserDAO().finduser(userform.getUsername(), userform.getPassword();/將用戶從登陸頁面輸入的用戶名和密碼與user表中用戶名與密碼核對,若不一致,生成錯誤信息,返回到登陸頁面 if(bean=null)
15、60; request.setAttribute("login.error", "您還沒有注冊,請先注冊!"); return mapping.findForward("login.error"); else String status=bean.getStatus();
16、160; if(status.equals("0") request.setAttribute("login.error", "抱歉,您的帳戶正在審批中,暫時(shí)無法登陸!");/若用戶名和密碼一致,再次核對用戶審批狀態(tài),未審批完成,生成提示信息并返回首頁 return mapping.findForw
17、ard("login.error"); List kind=new KindDAO().findKind(userform.getUsername(); List diary=new DiaryDAO().findDiaryByUser(bean.getUsername(); request.setAttribute("diary", diary); request.getSession().
溫馨提示
- 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)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 能源利用與社會發(fā)展課件
- 《風(fēng)險(xiǎn)管理課程》課件
- 主題班會課件交通安全
- 《健康養(yǎng)生中風(fēng)》課件
- 《氣管插管術(shù)概況》課件
- 《華生的行為主義》課件
- 《童話故事拼音》課件
- DB37-T 4394.4-2024 政務(wù)云平臺 第4部分:系統(tǒng)部署和遷移要求
- DB37-T 4421-2021 淺海模塊化地質(zhì)鉆探平臺設(shè)計(jì)規(guī)范
- 《人種有不同》課件
- 成本合約規(guī)劃培訓(xùn)
- 山東省濟(jì)寧市2025屆高三歷史一輪復(fù)習(xí)高考仿真試卷 含答案
- 五年級數(shù)學(xué)(小數(shù)乘法)計(jì)算題專項(xiàng)練習(xí)及答案
- 交通法規(guī)教育課件
- 產(chǎn)前診斷室護(hù)理工作總結(jié)
- 6S管理知識培訓(xùn)課件
- 小學(xué)校長任期五年工作目標(biāo)(2024年-2029年)
- 醫(yī)院培訓(xùn)課件:《猴痘流行病學(xué)特點(diǎn)及中國大陸首例猴痘病例調(diào)查處置》
- 氫氣-安全技術(shù)說明書MSDS
- 產(chǎn)科護(hù)士臨床思維能力培養(yǎng)
- 開曼群島公司法2024版中文譯本(含2024年修訂主要內(nèi)容)
評論
0/150
提交評論