<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 7,  comments - 8,  trackbacks - 0
    http.js
    ?1var?HTTP?=?{
    ?2xmlHttp?:?null,
    ?3callBack?:?function?(content){},
    ?4createXMLHttpRequest?:?function?(){
    ?5?if(window.ActiveXObject){
    ?6??this.xmlHttp?=?new?ActiveXObject("Microsoft.XMLHTTP");
    ?7?}

    ?8?else?if(window.XMLHttpRequest){
    ?9??this.xmlHttp?=?new?XMLHttpRequest();
    10?}

    11}
    ,
    12get?:?function?(url){
    13?this.createXMLHttpRequest();
    14?try{
    15?this.xmlHttp.open("GET",url,true);
    16?this.xmlHttp.onreadystatechange?=?this.startCallback;
    17?this.xmlHttp.send(null);
    18?}
    catch(e){alert(e.message);}
    19}
    ,
    20startCallback?:?function?(){
    21?if(HTTP.xmlHttp.readyState?==?4){
    22??if(HTTP.xmlHttp.status?==?200){
    23???HTTP.callBack(HTTP.xmlHttp.responseText);
    24??}

    25?}

    26}
    }

    xml.js
    ??1var?maxPage?=?1;
    ??2var?XMLDATA?=?{
    ??3data?:?"",
    ??4num?:?0,
    ??5page?:?0,
    ??6pageSize?:?12,
    ??7literals?:?new?Array("確定要刪除?","確定要執行操作?"),
    ??8waite?:?function(){
    ??9????if(""==this.data?&&?this.num<5){
    ?10????????setTimeout("XMLDATA.waite()",100);
    ?11????????this.num++;
    ?12????}
    else?if(this.num==5){
    ?13????????alert("err");
    ?14????}
    else{
    ?15????????var?p?=?new?DOMParser();
    ?16????????try{
    ?17????????????var?doc?=?p.parseFromString(this.data,"text/xml");
    ?18????????}
    catch(e){return;}
    ?19????????this.parse(doc);
    ?20????}

    ?21}
    ,
    ?22initialize?:?function?(u){
    ?23if(window.DOMParser)//firefox內核的瀏覽器
    ?24{
    ?25????HTTP.callBack?=?function?(content){
    ?26????????????XMLDATA.data?=?content;
    ?27????????}
    ;
    ?28????HTTP.get(u);
    ?29????setTimeout("XMLDATA.waite()",100);
    ?30????return?true;
    ?31}

    ?32else?if(?window.ActiveXObject?)//ie內核的瀏覽器
    ?33{
    ?34????this.data?=?"Microsoft";
    ?35????var?doc?=?new?ActiveXObject(?"Microsoft.XMLDOM"?);
    ?36????doc.async?=?false;
    ?37????doc.load(u);
    ?38????this.parse(doc);
    ?39????return?true;
    ?40}

    ?41else
    ?42????return?false;
    ?43}
    ,
    ?44searchclass?:?function?()
    ?45{
    ?46????document.all.pageadd.value?=?0;
    ?47????this.getteach();
    ?48}
    ,
    ?49xmlRefresh?:?function?(){
    ?50????this.getteach(document.all.pageadd.value);
    ?51}
    ,
    ?52$?:?function?(f){
    ?53????return?document.getElementById(f);
    ?54}
    ,
    ?55execute?:?function?(url){
    ?56????XMLDATA.$("showXml").innerHTML?=?"正在執行操作";
    ?57????HTTP.callBack?=?function?(content){
    ?58????????if(content=="1")
    ?59????????????XMLDATA.$("showXml").innerHTML?=?"操作成功,正在加載數據";
    ?60????????else
    ?61????????????XMLDATA.$("showXml").innerHTML?=?"操作失敗,正在加載數據";
    ?62????????setTimeout("XMLDATA.xmlRefresh()",1000);
    ?63????}
    ;
    ?64????HTTP.get(url);
    ?65}
    ,
    ?66getteach?:?function?(fun){
    ?67????this.$("showXml").innerHTML?=?"正在加載數據";
    ?68????var?n;
    ?69????n?=?parseInt(document.all.pageadd.value);
    ?70????if(isNaN(parseInt(fun))){
    ?71????????if(fun?==?"sub"){n?=?n?-?1;}else{n?=?n?+?1;}
    ?72????}
    else{
    ?73????????n?=?parseInt(fun);
    ?74????}

    ?75????this.displayPre(!(n?<=?1));
    ?76????this.displayNext(false);
    ?77????document.all.pageadd.value?=??n;
    ?78????this.page?=?n;
    ?79????var?xmlurl?=?"/user/xml.htm?method="+method+"&n="+n;
    ?80????if(typeof(userId)!="undefined")xmlurl?+=?"&userId="+userId;
    ?81????if(typeof(args)!="undefined"?&&?args!=null)xmlurl?+=?"&"+args;
    ?82????if(!this.initialize(xmlurl)){
    ?83????????this.$("showXml").innerHTML?=?"沒有找到任何數據!";
    ?84????}
    else?{
    ?85??????
    ?86????}

    ?87??}
    ,
    ?88getNodeText?:?function(nodes,o){
    ?89????return?nodes.getElementsByTagName(o)[0].firstChild.nodeValue;
    ?90??}
    ,
    ?91nextNode?:?function(root,i){
    ?92????return?root.childNodes[i];
    ?93??}
    ,
    ?94getAttribute?:?function(node,name){
    ?95????for(i=0;i<node.attributes.length;i++)
    ?96????if(name==node.attributes[i].name)
    ?97????????return?node.attributes[i].value;
    ?98????return?null;
    ?99??}
    ,
    100getNodeName?:?function(node){
    101?????return?node.nodeName;
    102??}
    ,
    103getNodeValue?:?function(node){
    104????return?node.firstChild.nodeValue;
    105??}
    ,
    106parse?:?function(xmldoc){
    107????var?n?=?this.page;
    108????var?xmlroot?=?xmldoc.documentElement;
    109??????var?showStr?=?'<table?width="90%"?border="0"?cellspacing="0"?cellpadding="0">';
    110??????var?j,i,num;
    111??????var?node?=?xmlroot.childNodes.length;
    112??????var?nodes;
    113??????i?=?0;
    114??????while(i?!=?node){
    115????????????showStr?+=?"<tr>";
    116??????????????nodes?=?this.nextNode(xmlroot,i);
    117??????????????if(i?==?0)
    118??????????????{
    119??????????????maxPage?=?this.getNodeText(nodes,"page");
    120??????????????this.pageSize?=?parseInt(this.getNodeText(nodes,"size"));
    121??????????????this.displayNext(!(node<this.pageSize));
    122??????????????document.all.pagecount.innerHTML?=?'第?'+n+'?頁'+'(共'+this.getNodeText(nodes,"page")+'頁)';
    123??????????????}

    124??????????????this.displayNext(maxPage>1?&&?n<maxPage);
    125??????????????if(nodes?==?null)
    126??????????????{
    127????????????????showStr?+=?'</tr></table>';
    128????????????????this.$("showXml").innerHTML?=?showStr;
    129????????????????return;
    130??????????????}

    131?????????????j=0;
    132?????????????nodes_its?=?nodes.childNodes;
    133?????????????num?=?nodes_its.length;
    134?????????????while(j?!=?num){
    135??????????????nnn?=?this.nextNode(nodes,j);
    136??????????????j++;
    137??????????????if(nnn?==?null)
    138??????????????{
    139????????????????break;
    140??????????????}

    141??????????????if(this.getNodeName(nnn)!="pro")continue;
    142??????????????showStr?+=?"<td>";
    143??????????????if(this.getAttribute(nnn,"url")!=null){
    144????????????????showStr?+=?"<a?";
    145????????????????this.getAttribute(nnn,"confirm")=="true"?
    146????????????????showStr?+="href=\"javaScript:;\"?onClick=\"XMLDATA.confirm('"+this.getAttribute(nnn,"url")+"',XMLDATA.literals["+this.getAttribute(nnn,"literal")+"]);\">"
    147????????????????:showStr?+="href=\""+this.getAttribute(nnn,"url")+"\"?target='_blank'>";
    148????????????????showStr?+=?this.getNodeValue(nnn);
    149????????????????showStr?+=?"</a>";
    150??????????????}
    else{showStr?+=?this.getNodeValue(nnn);}
    151??????????????showStr?+=?'</td>';
    152????????????}

    153??????????showStr?+=?'</tr>';
    154??????????i++;
    155??????}

    156??????showStr?+=?'</table>';
    157??????if(showStr?==?'<table?width="90%"?border="0"?cellspacing="0"?cellpadding="0"></table>')
    158??????{this.$("showXml").innerHTML?=?"沒有找到任何數據!";if(this.page>1)this.getteach(this.page-1);}
    159??????else
    160??????{this.$("showXml").innerHTML?=?showStr;}
    161}
    ,
    162displayNext?:?function?(flag){
    163??????if(flag)
    164??????{document.all.next.style.display?=??"";
    165???????document.all.next2.style.display?=??"";}
    else
    166??????{document.all.next.style.display?=??"none";
    167???????document.all.next2.style.display?=??"none";}

    168}
    ,
    169displayPre?:?function?(flag){
    170??????if(flag)
    171??????{document.all.pre.style.display?=??"";
    172???????document.all.pre2.style.display?=??"";}

    173??????else
    174??????{document.all.pre.style.display?=??"none";
    175???????document.all.pre2.style.display?=??"none";}

    176}
    ,
    177confirm?:?function?(url,literal){
    178??????if(!confirm(literal))?return?false;
    179??????XMLDATA.execute(url);
    180}

    181}

    182window.onload?=?function(){XMLDATA.searchclass();};


    JAVA類
    ??1public?class?XmlHelper?{
    ??2????PrintWriter?pw;
    ??3????private?boolean?startItemed?=?false;
    ??4????private?boolean?endItemed?=?true;
    ??5????private?boolean?endRooted?=?false;
    ??6????private?boolean?inited?=?false;
    ??7????private?int?page;
    ??8????private?int?pageSize;
    ??9????private?int?defaultPageSize?=?20;
    ?10????private?static?final?int?LITERAL_DELETE?=?0;
    ?11????private?static?final?int?LITERAL_OPERATE?=?1;
    ?12????
    ?13????public?XmlHelper(PrintWriter?pw,?int?totalPage)?{
    ?14????????this.pw?=?pw;
    ?15????????this.pw.write("<?xml?version=\"1.0\"?encoding=\"utf-8\"?><root>");
    ?16????????endRooted?=?false;
    ?17????????this.page?=?totalPage;
    ?18????????this.pageSize?=?defaultPageSize;
    ?19????}

    ?20
    ?21????public?XmlHelper(PrintWriter?pw,?int?totalPage,int?size)?{
    ?22????????this.pw?=?pw;
    ?23????????this.pw.write("<?xml?version=\"1.0\"?encoding=\"utf-8\"?><root>");
    ?24????????endRooted?=?false;
    ?25????????this.page?=?totalPage;
    ?26????????this.pageSize?=?size;
    ?27????}

    ?28
    ?29????public?void?startItem()?{
    ?30????????if?(endRooted)
    ?31????????????throw?new?XMLException("root?already?end!");
    ?32????????if?(!endItemed)
    ?33????????????throw?new?XMLException("previous?item?not?end!");
    ?34????????pw.write("<item>");
    ?35????????startItemed?=?true;
    ?36????????endItemed?=?false;
    ?37????}

    ?38
    ?39????public?void?endItem()?{
    ?40????????if?(endRooted)
    ?41????????????throw?new?XMLException("root?already?end!");
    ?42????????if?(!startItemed)
    ?43????????????throw?new?XMLException("the?item?not?start!");
    ?44????????if(!inited){
    ?45????????????pw.write("<page>");
    ?46????????????pw.write(page?+?"");
    ?47????????????pw.write("</page>");
    ?48????????????pw.write("<size>");
    ?49????????????pw.write(pageSize?+?"");
    ?50????????????pw.write("</size>");
    ?51????????????inited?=?true;
    ?52????????}

    ?53????????pw.write("</item>");
    ?54????????startItemed?=?false;
    ?55????????endItemed?=?true;
    ?56????}

    ?57
    ?58????public?void?writeText(String?text)?{
    ?59????????if?(endRooted)
    ?60????????????throw?new?XMLException("root?already?end!");
    ?61????????pw.write("<pro><![CDATA[");
    ?62????????pw.write(trip(text));
    ?63????????pw.write("]]></pro>");
    ?64????}

    ?65
    ?66????public?void?writeText(String?url,?String?text)?{
    ?67????????if?(endRooted)
    ?68????????????throw?new?XMLException("root?already?end!");
    ?69????????pw.write("<pro");
    ?70????????pw.write("?url=\"");
    ?71????????pw.write(trip(url));
    ?72????????pw.write("\"><![CDATA[");
    ?73????????pw.write(trip(text));
    ?74????????pw.write("]]></pro>");
    ?75????}

    ?76
    ?77????public?void?writeConfirmText(String?url,?String?text)?{
    ?78????????if?(endRooted)
    ?79????????????throw?new?XMLException("root?already?end!");
    ?80????????pw.write("<pro");
    ?81????????pw.write("?url=\"");
    ?82????????pw.write(trip(url));
    ?83????????pw.write("\"?confirm=\"true\"?literal=\""+LITERAL_DELETE+"\"><![CDATA[");
    ?84????????pw.write(trip(text));
    ?85????????pw.write("]]></pro>");
    ?86????}

    ?87????
    ?88????/**
    ?89?????*?@param?url
    ?90?????*?@param?text
    ?91?????*?@param?lan?(LAN_DELETE)
    ?92?????*/

    ?93????public?void?writeConfirmText(String?url,?String?text,?int?literal)?{
    ?94????????if?(endRooted)
    ?95????????????throw?new?XMLException("root?already?end!");
    ?96????????pw.write("<pro");
    ?97????????pw.write("?url=\"");
    ?98????????pw.write(trip(url));
    ?99????????pw.write("\"?confirm=\"true\"?literal=\""+literal+"\"><![CDATA[");
    100????????pw.write(trip(text));
    101????????pw.write("]]></pro>");
    102????}

    103????
    104????private?String?trip(String?text){
    105????????return?text==null?"":text;
    106????}

    107
    108????public?void?end()?{
    109????????if?(endRooted)
    110????????????throw?new?XMLException("root?already?end!");
    111????????pw.write("</root>");
    112????????endRooted?=?true;
    113????}

    114????
    115????public?class?XMLException?extends?RuntimeException?{
    116????????public?XMLException(String?message)?{
    117????????????super(message);
    118????????}

    119????}

    120}

    ?1public?ActionForward?comment(ActionMapping?mapping,?ActionForm?form,
    ?2????????????HttpServletRequest?request,?HttpServletResponse?response)
    ?3????????????throws?Exception?{
    ?4????????String?n?=?request.getParameter("n");
    ?5????????int?pageNo?=?1;
    ?6????????if?((n?==?null)?||?((pageNo?=?Integer.valueOf(n))?<=?0))?{
    ?7????????????pageNo?=?1;
    ?8????????}

    ?9????????int?pageSize?=?defaultPageSize;
    10????????UserService?service?=?(UserService)?getService("userService");
    11????????long?userId?=?getUserId(request);
    12????????List<ArticleCommentInfo>?listPapooseCommonList?=?service
    13????????????????.getPapooseCommonUserList(pageNo,?pageSize,?userId);
    14
    15????????int?total?=?service.getPapooseCommonUserListSeekDonativeList(userId);
    16????????int?totalPage?=?total?/?pageSize;
    17????????int?remain?=?total?%?pageSize;
    18????????if?(remain?>?0)?{
    19????????????totalPage++;
    20????????}

    21????????response.setContentType("text/xml");
    22????????PrintWriter?pw?=?response.getWriter();
    23????????XmlHelper?xmlh?=?new?XmlHelper(pw,?totalPage,?defaultPageSize);
    24????????boolean?confirm?=?privilege(request)?==?3;
    25????????for?(ArticleCommentInfo?pb?:?listPapooseCommonList)?{
    26????????????xmlh.startItem();
    27????????????xmlh.writeText("["
    28????????????????????+?(pb.getPapoose().getType()?==?0???"親子園"?:?"幼兒園")?+?"]");
    29????????????xmlh.writeText(
    30????????????????????"/papooseSelect/score.htm?method=scorePapoose&amp;papoose.id="
    31????????????????????????????+?pb.getPapoose().getId(),?pb.getPapoose()
    32????????????????????????????.getPapooseName());
    33????????????xmlh.writeText(
    34????????????????????"/papooseSelect/score.htm?method=scorePapoose&amp;papoose.id="
    35????????????????????????????+?pb.getPapoose().getId(),?StringUtils.substring(pb
    36????????????????????????????.getContent(),?0,?30));
    37????????????xmlh.writeText(DateUtils
    38????????????????????.formatDate(pb.getIssueDate(),?"yyyy-MM-dd"));
    39????????????if?(confirm)
    40????????????????xmlh.writeConfirmText(
    41????????????????????????"/user/room.htm?method=removePapooseReview&amp;id="
    42????????????????????????????????+?pb.getId(),
    43????????????????????????"刪除");
    44????????????xmlh.endItem();
    45????????}

    46????????xmlh.end();
    47????????return?null;
    48????}


    HTML
    ?1<html?xmlns="http://www.w3.org/1999/xhtml">
    ?2<head>
    ?3<meta?http-equiv="Content-Type"?content="text/html;?charset=gb2312"?/>
    ?4<title>參與的愛心求助</title>
    ?5<SCRIPT?LANGUAGE="JavaScript">
    ?6?<!--
    ?7var?method?=?"appeal";
    ?8?//-->
    ?9?
    </SCRIPT>
    10?<SCRIPT?LANGUAGE="JavaScript"?SRC="/js/http.js"></SCRIPT>
    11?<SCRIPT?LANGUAGE="JavaScript"?SRC="/js/xml.js"></SCRIPT>
    12</head>
    13<body>
    14<table?width="100%"?border="0"?cellspacing="0"?cellpadding="0">
    15??<tr>
    16????<td><table?width="100%"?border="0"?cellspacing="0"?cellpadding="0">
    17??????<tr>
    18????????<td?width="118"?height="28"?align="center"?background="/img/micon12.gif"?class="cn12a?blue03"><STRONG>參與的愛心求助</STRONG></td>
    19????????<td?class="table07"><span?class="cn12a">&nbsp;</span></td>
    20??????</tr>
    21????</table></td>
    22??</tr>
    23??<tr>
    24????<td?valign="top"?bgcolor="#FFFFFF"?class="table08"?style="padding:12"><div?id="showXml">正在加載中</div></td>
    25??</tr>
    26?<tr><td?height="38"?align="right"?style="padding-right:6"?class="cn12a"><input?type="hidden"id="search_category"/>?<input?type="hidden"?id="pageadd"?value="0"/><span?id="pagecount"></span>????????<span?id="pre2"><A?href="javaScript:XMLDATA.searchclass();"?class="cn12a?gry"?>[首頁]</A></span>?<span?id="pre"><A?href="javaScript:XMLDATA.getteach('sub');"?class="cn12a?gry">[上一頁]</A></span>?<span?id="next"><A?href="javaScript:XMLDATA.getteach('in');"?class="cn12a?gry">[下一頁]</A></span>?<span?id="next2"><A?href="javaScript:XMLDATA.getteach(maxPage);"?class="cn12a?gry">[末頁]</A></span></td>
    27??</tr>
    28</table>
    29</body>
    30</html>
    posted on 2007-03-01 00:01 鹽巴 閱讀(706) 評論(0)  編輯  收藏 所屬分類: 網站技術

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     
    主站蜘蛛池模板: 国产偷国产偷亚洲清高动态图| 亚洲一级高清在线中文字幕| 免费精品国产日韩热久久| 精品国产免费人成网站| 亚洲av日韩综合一区久热| 亚洲视频免费播放| 亚洲Av无码精品色午夜| 亚洲国产天堂久久久久久| 永久黄网站色视频免费| 57PAO成人国产永久免费视频| 精品免费视在线观看| 国产免费久久精品丫丫| 美女露隐私全部免费直播| 亚洲依依成人亚洲社区| 亚洲18在线天美| 亚洲福利电影一区二区?| 久久久无码精品亚洲日韩蜜桃| 国产自偷亚洲精品页65页| 亚洲成av人片天堂网老年人| 国产无遮挡裸体免费视频 | 无码乱人伦一区二区亚洲一| 中国亚洲女人69内射少妇| 亚洲AV无码一区二三区 | 国产精品亚洲精品日韩电影| 亚洲国产精品99久久久久久| 亚洲最大的成人网站| 激情综合亚洲色婷婷五月| 亚洲香蕉久久一区二区三区四区| 亚洲宅男永久在线| 久久亚洲精品成人av无码网站| 亚洲人成网www| 亚洲尹人香蕉网在线视颅| 亚洲男女一区二区三区| 亚洲一级黄色大片| 亚洲色欲啪啪久久WWW综合网| 亚洲色丰满少妇高潮18p| 亚洲精品无码久久久久久| 偷自拍亚洲视频在线观看99| 国产成人亚洲午夜电影| 一边摸一边桶一边脱免费视频| selaoban在线视频免费精品|