




下載本文檔
版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
JavaStrutsNETCTOSS資費(fèi)的分頁(yè)顯OGNL基本語(yǔ)ValueStack結(jié)重構(gòu)NETCTOSS資費(fèi)列表顯示(分頁(yè)版
圖-圖-
圖-圖-在你的myeclipse點(diǎn)中struts02_1工程,右鍵Properties,找到MyEclipse下的Web,顯示內(nèi)如圖-5所示。找到webContext-root可以看到文本框中的名字還是struts01_2,而我們當(dāng)前的工程名為struts02_1,所以修改webContext-root為struts02_1,這樣部署到tomcat下的工程名和myeclipse圖-packagepackageprivatestaticfinalStringfindAll"selectID,NAME,BASE_DURATION,BASE_COST,UNIT_COST,CREATIME,ST"selectrownumr,ID,NAME,BASE_DURATION,BASE_COST,UNIT_COST"wherea.r>?privatestaticfinalStringgetTotalPages="selectcount(*)fromCOST";
圖-classFeeDAOpublicintgetTotalPages(intpageSize)Connectioncon=PreparedStatementstmt=ResultSetrs=trycon=stmt=rs=inttotalRows=if(totalRows%pageSize==0)returntotalRows/}elsereturntotalRows/pageSize+}}catch(Exceptione)thrownew}finally{}}publicList<Fee>findAll(intpage,int{Connectioncon=PreparedStatementstmt=ResultSetrs=trycon=stmt=intbegin=(intend=stmt.setInt(1,stmt.setInt(2,rs=List<Fee>list=newwhile(rs.next())Feefee=new return}catch(Exceptione)thrownew}finally{}}}修改publicclassFeeListActionprivateprivateprivateList<Fee>feeList=intpage=1;inttotalPages;publicintgetTotalPages()return} publicvoidsetTotalPages(inttotalPages)
this.totalPages=}publicStringFeeDAOfeeDAO=newFeeDAO();feeList=feeDAO.findAll(page,3);totalPages=feeDAO.getTotalPages(3);return"success";}publicint{return}publicvoidsetPage(int{this.page=}publicList<Fee>{return}publicvoidsetFeeList(List<Fee>{this.feeList=}}修改<%@pagelanguage="java"pageEncoding="UTF-<%@taglib/jsp/jstl/core"<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN".<html<metahttp-equiv="Content-Type"content="text/html;charset=utf-<linktype="text/css"rel="stylesheet"media="all"<linktype="text/css"rel="stylesheet"media="all"<!--Logo<div<imgsrc="../images/logo.png"alt="logo"<ahref="#">[<!--Logo<!--導(dǎo)航區(qū)域開(kāi)始--><div<ul <li><ahref="../index.html"<li><ahref="../role/role_list.html"<li><ahref="../admin/admin_list.html"<li><ahref="../fee/fee_list.html"<li><ahref="../account/account_list.html"<li><ahref="../service/service_list.html"<li><ahref="../bill/bill_list.html"<li><ahref="../report/report_list.html"<li><ahref="../user/user_info.html"<li><ahref="../user/user_modi_pwd.html"<!--導(dǎo)航區(qū)域結(jié)束--><!--主要區(qū)域開(kāi)始--><div<formaction=""<!--排序--><div<inputtype="button"value="月租"<inputtype="button"value="基費(fèi)"<inputtype="button"value="時(shí)長(zhǎng)"<inputtype="button"value="增加"class="btn_add"<divid="operate_result_info"<imgsrc="../images/close.png"<div<table<th>資費(fèi)<thclass="width100">資費(fèi)名稱<th>基本時(shí)長(zhǎng)<th>基本費(fèi)用<th>單位費(fèi)用<th>創(chuàng)建時(shí)間<th>開(kāi)通時(shí)間<thclass="width50">狀態(tài)<th<c:forEachitems="${feeList}"<td>${fee.baseDuration}小時(shí)<td>${fee.baseCost}元<td>${fee.unitCost}元/小時(shí)<c:iftest="${fee.status==0}"<c:iftest="${fee.status==1}"<c:iftest="${fee.status==2}"<c:iftest="${fee.status!=0&&<inputtype="button"value=c<inputtype="button"value=c<inputtype="button"value=c<p>業(yè)務(wù)說(shuō)明:<br/>1、創(chuàng)建資費(fèi)時(shí),狀態(tài)為暫停,記載創(chuàng)建時(shí)間;<br/>2、暫停狀態(tài)下,可修改,可刪除;<br/>34<!--分頁(yè)--><div<c:whentest="${page><ahref="feeList.action?page=${1}"><c:forEachvar="p"begin="1"end="${totalPages}"><c:whentest="${page==<ahref="feeList.action?page=${p}"<ahref="feeList.action?page=${p}">${p<c:whentest="${page<<ahref="feeList.action?page=${page+1}<!--主要區(qū)域結(jié)束--><div<p>[源自的技術(shù),最優(yōu)秀的師資,最真實(shí)的企業(yè)環(huán)境,最適用的<p>(C)達(dá)內(nèi)IT培訓(xùn)公司,如圖-6圖-packageclassFeeDAOprivatestaticfinalStringfindAll"selectID,NAME,BASE_DURATION,BASE_COST,UNIT_COST,CREATIME,"selectrownumr,ID,NAME,BASE_DURATION,BASE_COST,"wherea.r>?privatestaticfinalStringgetTotalPages"selectcount(*)fromCOST";publicintgetTotalPages(intpageSize)Connectioncon=PreparedStatementstmt=ResultSetrs=trycon=stmt=rs=inttotalRows=if(totalRows%pageSize==0)returntotalRows/}elsereturntotalRows/pageSize+}}catch(Exceptione)thrownew}finally{ publicList<Fee>findAll(intpage,intpageSize)Connectioncon=PreparedStatementstmt=ResultSetrs=trycon=stmt=intbegin=(intend=stmt.setInt(1,stmt.setInt(2,rs=List<Fee>list=newwhile(rs.next())Feefee=new return}catch(Exceptione)thrownew}finally{ }publicclassFeeListActionprivateList<Fee>feeList=privateintpage=privateinttotalPages;publicintgetTotalPages()return publicvoidsetTotalPages(inttotalPages)this.totalPages= publicStringFeeDAOfeeDAO=newfeeList=totalPages=return publicintgetPage()return publicvoidsetPage(intpage)this.page= publicList<Fee>getFeeList()return publicvoidsetFeeList(List<Fee>feeList)this.feeList=}}<%@pagelanguage="java"pageEncoding="UTF-<%@taglib /jsp/jstl/core"<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN" <html <metahttp-equiv="Content-Type"content="text/html;charset=utf-<linktype="text/css"rel="stylesheet"media="all"<linktype="text/css"rel="stylesheet"media="all"<!--Logo<div<imgsrc="../images/logo.png"alt="logo"<ahref="#">[<!--Logo<!--導(dǎo)航區(qū)域開(kāi)始--><div<ul <li><ahref="../index.html"<li><ahref="../role/role_list.html"<li><ahref="../admin/admin_list.html"<li><ahref="../fee/fee_list.html"<li><ahref="../account/account_list.html"<li><ahref="../service/service_list.html"<li><ahref="../bill/bill_list.html"<li><ahref="../report/report_list.html"<li><ahref="../user/user_info.html"<li><ahref="../user/user_modi_pwd.html"<!--導(dǎo)航區(qū)域結(jié)束--><!--主要區(qū)域開(kāi)始--><div<formaction=""<!--排序--><div<inputvalue="<inputvalue="<inputvalue=" <inputtype="button"value="增加"class="btn_add" <divid="operate_result_info" <imgsrc="../images/close.png" <div <table <th>資費(fèi) <thclass="width100" <thclass="width50 <th <c:forEachitems="${feeList}" <td>${fee.baseDuration} <td>${fee.baseCost}元</ <td>${fee.unitCost}元/小時(shí)</<c:iftest="${fee.status==0}"<c:iftest="${fee.status==1}"<c:iftest="${fee.status==2}"<c:iftest="${fee.status!=0&&<inputtype="button"value=c<inputtype="button"value=c<inputtype="button"value=c<p>業(yè)務(wù)說(shuō)明:<br/>1、創(chuàng)建資費(fèi)時(shí),狀態(tài)為暫停,記載創(chuàng)建時(shí)間;<br/>2、暫停狀態(tài)下,可修改,可刪除;<br/>34<!--分頁(yè)--><div<c:whentest="${page><ahref="feeList.action?page=${1}">上一頁(yè)<c:forEachvar="p"begin="1"<c:whentest="${page==<ahref="feeList.action?page=${p}"<ahref="feeList.action?page=${p}">${p<c:whentest="${page<<ahref="feeList.action?page=${page+1}<!--主要區(qū)域結(jié)束--><div<p>[源 公司1.4擴(kuò)展。IntegergetId(){returnvoidsetId(Integerid){this.id=StringgetName(){returnvoidsetName(Stringname){=String[]getArry(){returnvoidsetArry(String[]arry){this.arry=List<String>getList(){returnvoidsetList(List<String>list){this.list=Map<String,String>getMap(){returnvoidsetMap(Map<String,String>map){this.map=}publicclassFooprivateprivateIntegerStringprivateString[]privateList<String>list;privateMap<String,String>map;3.新建類TestOgnl01.java,演示基本類型屬性,數(shù)組、List屬性,MappublicclassTestOgnl01publicstaticvoidmain(String[]args)throws{Foofoo=newfoo.setArry(newString[]{"one","two","three"foo.setList(Arrays.asList("A","B","C"));HashMap<String,String>map=newHashMap<String,map.put("one",map.put("two",map.put("three",/*Ognl引 *Ognl.getValue("OGNL表達(dá)式",root對(duì)象);//root對(duì)象是Ognl//1.基本類型屬性(包括System.out.println(Ognl.getValue("id",System.out.println(Ognl.getValue("name",//2.數(shù)組、List //3.Map System.out.println(Ognl.getValue("map['two']",//4.System.out.println(Ognl.getValue("id+100",System.out.println(Ognl.getValue("\"Whatis\"+name",System.out.println(Ognl.getValue("\"name:\"+name+\"id:\"System.out.println(Ognl.getValue("id>150",//5. System.out.println(Ognl.getValue("list.size()", Ognl.getValue("map['three'].lastIndexOf(name)",//6.//7.創(chuàng)建的ListObjectobj=Ognl.getValue("{1,2,3,4,5}",//8.創(chuàng)建的Mapobj="#{1:'java',2:'javajava',3:'javajavajava'}", 新建
圖-publicclassBarprivateStringpublicStringgetName(){returnpublicvoidsetName(Stringname){=}publicclassTestOgnl02publicstaticvoidmain(String[]args)throwsExceptionMap<String,Object>ctxnewHashMap<StringObject>();ctx.put("num",10);//rootBarroot=new}}圖-publicclassFooprivateprivateprivateprivateprivateIntegerStringname;String[]arry;List<String>list;Map<String,String>publicIntegergetId(){returnpublicvoidsetId(Integerid){this.id=id;}publicStringgetName(){returnname;}publicvoidsetName(Stringname){=name;}publicString[]getArry(){returnarry;}publicvoidsetArry(String[]arry){this.arry=arry;}publicList<String>getList(){returnlist;}publicvoidsetList(List<String>list){this.list=publicMap<String,String>getMap(){return publicvoidsetMap(Map<String,String>map){this.map=}}publicclassTestOgnl01publicstaticvoidmain(String[]args)throwsExceptionFoofoo=newFoo();foo.setArry(newString[]{"one","two","three"foo.setList(Arrays.asList("A","B",HashMap<String,String>mapnewHashMap<String,map.put("one",map.put("two",map.put("three",/*Ognl引 *Ognl.getValue("OGNL表達(dá)式",root對(duì)象);//root對(duì)象是Ognl//1.基本類型屬性(包括System.out.println(Ognl.getValue("id",System.out.println(Ognl.getValue("name",//2.數(shù)組、List//3.Map System.out.println(Ognl.getValue("map['two']",//4.System.out.println(Ognl.getValue("\"Whatis\"+name",System.out.println(Ognl.getValue("\"name:\"+name+\"id:\"System.out.println(Ognl.getValue("id>150",//5.System.out.println(Ognl.getValue("name.toUpperCase()",System.out.println(Ognl.getValue("list.size()",Ognl.getValue("map['three'].lastIndexOf(name)",//6.//7.創(chuàng)建的ListObjectobj=Ognl.getValue("{1,2,3,4,5}",//8.創(chuàng)建的Mapobj="#{1:'java',2:'javajava',3:'javajavajava'}","#{1:'java',2:'javajava',3:'javajavajava'}",}}publicclassBarprivateStringpublicStringgetName(){returnpublicvoidsetName(Stringname){=}} publicclassTestOgnl02publicstaticvoidmain(String[]args)throwsExceptionMap<String,Object>ctxnewHashMap<String,Object>();ctx.put("num",10);//rootBarroot=newBar();準(zhǔn)備好Struts2開(kāi)發(fā)環(huán)境a.新建web工程struts02_3packagepublicclassDebugActionprivateprivateprivateStringintid;String[]arry;publicStringexecute()name="java";id=100;return}publicintgetId(){returnpublicvoidsetId(intid){this.id=publicStringgetName(){returnpublicvoidsetName(Stringname){=}新建<?xmlversion="1.0"encoding="UTF-<!DOCTYPEstruts"-//ApacheSoftwareFoundation//DTDStrutsConfiguration"<packagename="valuestack"extends="struts-<actionname="debug"<resultname="success">/WEB-<%@pagepageEncoding="utf-<%@pageimport="java.util.*" Enumerationen= ement()+}//打印出Objectobj=request.getAttribute("struts.valueStack");out.println("<hr/>struts.valueStack對(duì)象:<br/>"+
圖-修改<%@pagepageEncoding="utf-<%@tagliburi="/struts-tags"Objectobj=<!--<s:debug8.,點(diǎn)擊[debug],顯示內(nèi)容如圖-圖-通用的標(biāo)記<s:propertyvalue=""/>Struts2自己定義的標(biāo)記庫(kù),用于valueStack,修<%@pagepageEncoding="utf-<%@tagliburi="/struts-tags"<!--struts2<s:propertyvalue=""/>標(biāo)記通過(guò)OGNL--<h2><s:propertyvalue="name"/><h2><s:propertyvalue="id"<h2><s:propertypackagepublicclassDebugActionprivateprivateprivateStringintid;String[]arry;}publicintgetId(){returnpublicvoidsetId(intid){this.id=publicStringgetName(){returnpublicvoidsetName(Stringname){=name;}publicString[]getArry(){returnarry;}publicvoidsetArry(String[]arry){this.arry=}
圖-publicString{name=id=arry=new{"spring"return修改<%@pagepageEncoding="utf-<%@tagliburi="/struts-tags"<s:propertyvalue="name+'java'"<s:propertyvalue="arry[1].toUpperCase()",結(jié)果如圖-12所示圖-publicclassDebugActionprivateprivateprivateStringintid;String[]arry;publicStringexecute()name="java";id=100;arry=newString[]"spring"};return}publicintgetId(){returnpublicvoidsetId(intid){this.id=publicStringgetName(){returnpublicvoidsetName(Stringname){=name;}publicString[]getArry(){returnarry;}publicvoidsetArry(String[]arry){this.arry=}<?xmlversion="1.0"encoding="UTF-<!DOCTYPEstruts"-//ApacheSoftwareFoundation//DTDStrutsConfiguration"<packagename="valuestack"extends="struts-<actionname="debug"<resultname="success">/WEB-</package><%@pagepageEncoding="utf-<%@tagliburi="/struts-tags"prefix="s"%> Objectobj= <!-- <s:debug<!--struts2通過(guò)標(biāo)記 <s:propertyvalue=""/>標(biāo)記通過(guò)OGNL表達(dá) --<h2><s:propertyvalue="name"/></h2><h2><s:propertyvalue="id"<!--可在value屬性內(nèi)做字符串拼接<s:propertyvalue="name+'java'"<!--可調(diào)用方法<s:propertyvalue="arry[1].toUpperCase()"a.<s:iteratorvalue=”ognl”>將onl指定的集合屬性循環(huán)迭代,在迭代中,將會(huì)當(dāng)前元素壓入o棧頂位置,因此使用”屬性”格式nl,此時(shí)定位的是元素屬性,而不是ion屬性。Iar循環(huán)結(jié)束后,ain對(duì)象又恢復(fù)成棧頂,a變量在on區(qū)域,需要使用”變量”<%@pagelanguage="java"pageEncoding="UTF-<%@tagliburi="/struts-tags"<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN" <html <metahttp-equiv="Content-Type"content="text/html;charset=utf-<linktype="text/css"rel="stylesheet"media="all"<linktype="text/css"rel="stylesheet"media="all"<!--Logo<div<imgsrc="../images/logo.png"alt="logo"<ahref="#">[<!--Logo<!--導(dǎo)航區(qū)域開(kāi)始--><div<ul <li><ahref="../index.html"<li><ahref="../role/role_list.html"<li><ahref="../admin/admin_list.html"<li><ahref="../fee/fee_list.html"<li><ahref="../account/account_list.html"<li><ahref="../service/service_list.html"<li><ahref="../bill/bill_list.html"<li><ahref="../report/report_list.html"<li><ahref="../user/user_info.html"<li><ahref="../user/user_modi_pwd.html"<!--導(dǎo)航區(qū)域結(jié)束--><!--主要區(qū)域開(kāi)始--><div<formaction=""<!--排序--><div<inputtype="button"value="月租"<inputtype="button"value="基費(fèi)"<inputtype="button"value="時(shí)長(zhǎng)"<inputtype="button"value="增加"class="btn_add"<divid="operate_result_info"<imgsrc="../images/close.png"<div<table<th>資費(fèi)<thclass="width100">資費(fèi)名稱<th>基本時(shí)長(zhǎng)<th>基本費(fèi)用<th>單位費(fèi)用<th>創(chuàng)建時(shí)間<th>開(kāi)通時(shí)間<thclass="width50">狀態(tài)<th<s:iterator<td><s:propertyvalue="id"<td><s:propertyvalue="feeName"<td><s:propertyvalue="baseDuration"<td><s:propertyvalue="baseCost"<td><s:propertyvalue="unitCost"<td><s:propertyvalue="createTime"<td><s:propertyvalue="startTime"<s:iftest="status==0"><s:iftest="status==1"><s:iftest="status==2"><s:iftest="status!=0&&status!=<inputtype="button"value="啟用"<inputtype="button"value="修改"<inputtype="button"value="刪除"<p>業(yè)務(wù)說(shuō)明:<br/>1、創(chuàng)建資費(fèi)時(shí),狀態(tài)為暫停,記載創(chuàng)建時(shí)間;<br/>2、暫停狀態(tài)下,可修改,可刪除;<br/>34<!--分頁(yè)--><div<s:iftest="page><ahref="feeList.action?page=${1}">上一頁(yè)</<s:iteratorvalue="newint[totalPages]"<s:iftest="#i.count==<ahref='feeList.action?page=<s:property<ahref='feeList.action?page=<s:property<s:iftest="page<<ahref="feeList.action?page=${page+1}">下一頁(yè)</<!--主要區(qū)域結(jié)束--><div<p>[源 公司<%@pagelanguage="java"pageEncoding="UTF-<%@tagliburi="/struts-tags"<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN".<html<metahttp-equiv="Content-Type"content="text/html;charset=utf-<linktype="text/css"rel="stylesheet"media="all"<linktype="text/css"rel="stylesheet"media="all"<!--Logo<div<imgsrc="../images/logo.png"alt="logo"<a
溫馨提示
- 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 美術(shù)素材考試題及答案
- 商業(yè)樓宇中央空調(diào)改造工程協(xié)議
- 市場(chǎng)推廣制作與執(zhí)行合同書(shū)
- 在線服務(wù)隱私保護(hù)合同協(xié)議書(shū)
- 金融投資產(chǎn)品開(kāi)發(fā)協(xié)議
- 貴州國(guó)企招聘2025貴州磷化(集團(tuán))有限責(zé)任公司招聘139人筆試參考題庫(kù)附帶答案詳解
- 2025黑龍江中鐵特貨物流股份有限公司招聘75人筆試參考題庫(kù)附帶答案詳解
- 2025廣東儲(chǔ)能產(chǎn)業(yè)發(fā)展有限公司招聘17人筆試參考題庫(kù)附帶答案詳解
- 2025年甘肅人力委托招聘蘭州地鐵安檢人員筆試參考題庫(kù)附帶答案詳解
- 贈(zèng)友送別類試題及答案
- 保密法實(shí)施條例培訓(xùn)
- 2022 年中國(guó)和美國(guó)的癌癥統(tǒng)計(jì)數(shù)據(jù):概況、趨勢(shì)和決定因素 Cancer statistics in China and United States,2022 profiles,trends,and determinants
- 2024年航空職業(yè)技能鑒定考試-深圳機(jī)場(chǎng)內(nèi)場(chǎng)機(jī)動(dòng)車駕駛員考試近5年真題附答案
- 三方共同借款協(xié)議書(shū)
- 同等學(xué)力英語(yǔ)申碩考試詞匯(第六版大綱)電子版
- 24秋國(guó)家開(kāi)放大學(xué)《當(dāng)代中國(guó)政治制度》形考任務(wù)1-4參考答案
- 專業(yè)教學(xué)資源庫(kù)備選項(xiàng)目材料-傳統(tǒng)手工業(yè)非遺技藝傳習(xí)與產(chǎn)業(yè)再造建設(shè)方案
- 高考生物試卷分析
- 三級(jí)公立醫(yī)院績(jī)效考核微創(chuàng)手術(shù)目錄(2022版)
- 湖北省武漢市東西湖區(qū)2023-2024學(xué)年八年級(jí)下學(xué)期期末考試語(yǔ)文試題
- JT-T-1180.10-2018交通運(yùn)輸企業(yè)安全生產(chǎn)標(biāo)準(zhǔn)化建設(shè)基本規(guī)范第10部分:水路危險(xiǎn)貨物運(yùn)輸企業(yè)
評(píng)論
0/150
提交評(píng)論