資源描述:
《取值在下拉列表框中顯示》由會(huì)員上傳分享,免費(fèi)在線閱讀,更多相關(guān)內(nèi)容在行業(yè)資料-天天文庫。
1、取值在下拉列表框中顯示驗(yàn)證碼驗(yàn)證publicActionForwardexecute(ActionMappingmapping,ActionFormform,HttpServletRequestrequest,HttpServletResponseresponse){DynaValidatorFormuserForm=(DynaValidatorForm)form;//TODOAuto-generatedmethodstubActionForwardforward=null;//當(dāng)用戶登錄時(shí)需填寫驗(yàn)證碼如不填則不能成功登錄HttpSessionsession=request.getS
2、ession();Stringrand=(String)session.getAttribute("rand");Stringinput=request.getParameter("rand");UserDtoudt=newUserDto();udt.setUsername(userForm.getString("username"));udt.setPassword(userForm.getString("password"));udt.setUsertype(Integer.parseInt(userForm.get("usertype").toString()));DataSo
3、urceds=getDataSource(request,"mssql");Connectioncon=null;try{con=ds.getConnection();UserDaoud=newUserDao(con);if(ud.checkLogin(udt)){if(udt.getUsertype()==0){forward=mapping.findForward("gs");System.out.println("登錄成功");System.out.println(userForm.get("username").toString());}if(udt.getUsertype(
4、)==1){forward=mapping.findForward("us");System.out.println("登錄成功");System.out.println(userForm.get("username").toString());}}else{forward=mapping.findForward("loginsh");System.out.println("登錄失敗");}if(rand.equals(input)){System.out.println("輸入相同,認(rèn)證成功!");}else{forward=mapping.findForward("loginsh
5、");System.out.println("輸入不同,認(rèn)證失??!");}}catch(SQLExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}returnforward;}}合同信息添加ActionpublicActionForwardselect_jfbm_jfdlbm(ActionMappingmapping,ActionFormform,HttpServletRequestrequest,HttpServletResponseresponse){DynaValidatorFormcontractFor
6、m=(DynaValidatorForm)form;//TODOAuto-generatedmethodstub//通過此方法將甲方和甲方代理人信息取出并在下拉列表框中顯示甲方編碼和甲方代理人編碼DataSourceds=getDataSource(request,"mssql");Connectioncon=null;ActionForwardforward=null;try{con=ds.getConnection();}catch(SQLExceptione){//TODOAuto-generatedcatchblocke.printStackTrace();}//將甲方編碼和
7、甲方代理人編碼查出來存放甲方信息的LabelValueBean//當(dāng)添加合同信息時(shí)、甲方和甲方代理人用下拉列表框顯示出來JfDaojd=newJfDao(con);JfdlDaojfd=newJfdlDao(con);Collectionjf=jd.jfshow();Collectionjfdl=jfd.jfdlshow();Listljf=newArrayList();Iteratoritit=jf.iterator();