Loading...

          java .net

          郁悶

          做了個(gè)小活兒弄得我不得安寧,

          心里有事兒,不安,做什么都沒(méi)心情,煩躁

          因?yàn)樾枰o人家去部署,跟公司說(shuō)有事出去,都不好意思了,好多次了,唉,,,

          這么點(diǎn)小事搞的我到處撞墻,老婆都跑了,怪我,太咯色,呵呵,

          知道她很想讓我?guī)鋈ス浣郑晌艺娴氖菦](méi)有心思,又不想讓她掃興,就這么不知如何是好的過(guò)了兩天

          她慌慌著五一回家,我確一點(diǎn)心思沒(méi)有,回家,向來(lái)對(duì)我沒(méi)有吸引力,家里人好像也沒(méi)問(wèn)過(guò)我回不回去

          有個(gè)哥們兒真是讓我煩,格格不入,也不知是我變了,還是他變了,或許是我太敏感了,越來(lái)越咯色

          妹妹與老婆的中間是我,讓我這個(gè)不善維和的笨蛋自己在這發(fā)霉,好像現(xiàn)在也沒(méi)什么,只是老婆發(fā)發(fā)牢騷,感覺(jué)有顆定時(shí)炸彈在我心中

          下午把跟隨我征戰(zhàn)北京的自行車騎回來(lái)了,騎自行車,爽

          自己悶在家里發(fā)呆,頭疼。

          我好想過(guò)個(gè)快樂(lè)的周末,好久沒(méi)有了。都怪自己沒(méi)能力,太嫩

          以前覺(jué)得自己挺會(huì)小資的,現(xiàn)在怎么這么機(jī)械了呢,越來(lái)越俗了。

          posted @ 2008-08-26 22:06 豬 閱讀(202) | 評(píng)論 (0)編輯 收藏

          //elm: div id

          //url:flash url

          //w:width

          //h:height

          function insertFlash(elm, url, w, h, id) {
          if (!document.getElementById(elm)) return;
          var str = '';
          str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" id='+id+'></embed>';
          document.getElementById(elm).innerHTML = str;
          }

          posted @ 2008-08-26 22:06 豬 閱讀(171) | 評(píng)論 (0)編輯 收藏
          import java.util.regex.Matcher;
          import java.util.regex.Pattern;
          public class Test
          {


              public static void main(String arg[])
              {
             
                  String s = "abc 123    456";
                  System.out.println(s);

                  while(true){
                 
                      int index = s.indexOf(" ");
                      if(index > 0){
                          s = s.replaceAll(" "," ");
                      }else{
                          break;
                      }
                  }
                 
                  System.out.println(s);
              }

          public static String replace(String inputStr, String replaceStr) {
                      Pattern p = Pattern.compile(" +");
                      Matcher m = p.matcher(inputStr);
                      return m.replaceAll(replaceStr);
                 }


          }
          posted @ 2008-08-26 22:06 豬 閱讀(293) | 評(píng)論 (0)編輯 收藏
          object oMissing = System.Reflection.Missing.Value;
                      Microsoft.Office.Interop.Word._Application oWord;
                      Microsoft.Office.Interop.Word._Document oDoc;
                      oWord = new Microsoft.Office.Interop.Word.Application();
                      //顯示word文檔
                      oWord.Visible = true;
                      //取得word文件模板
                      object fileName = System.Windows.Forms.Application.StartupPath + "\\word.doc";
                      //根據(jù)模板生成一個(gè)新文檔,相當(dāng)于另存為
                      oDoc = oWord.Documents.Add(ref fileName, ref oMissing,
                                      ref oMissing, ref oMissing);

                      //復(fù)制第一個(gè)表格
                      oDoc.Tables[1].Select();
                      oWord.Selection.Copy();

                      //在這里操作表格中的文本
                      oDoc.Tables[1].Cell(1, 1).Range.Text = "這是第一個(gè)表格";

                      //下一頁(yè)
                      object mymissing = System.Reflection.Missing.Value;
                      object myunit = Microsoft.Office.Interop.Word.WdUnits.wdStory;
                      oWord.Selection.EndKey(ref myunit, ref mymissing);
                      object pBreak = (int)Microsoft.Office.Interop.Word.WdBreakType.wdPageBreak;
                      oWord.Selection.InsertBreak(ref pBreak);

                      //粘貼第一個(gè)表格
                      oWord.Selection.Paste();

                      oDoc.Tables[2].Cell(1, 1).Range.Text = "這是第二個(gè)表格";
          posted @ 2008-08-26 22:06 豬 閱讀(2798) | 評(píng)論 (0)編輯 收藏

          net start OracleDBConsolezhaochun
          net start OracleOraDb10g_home1iSQL*Plus
          net start OracleOraDb10g_home1TNSListener
          net start OracleServiceZHAOCHUN


          net stop OracleDBConsolezhaochun
          net stop OracleOraDb10g_home1iSQL*Plus
          net stop OracleOraDb10g_home1TNSListener
          net stop OracleServiceZHAOCHUN

          把zhaochun改成自己的服務(wù)名
          posted @ 2008-08-26 22:06 豬 閱讀(208) | 評(píng)論 (0)編輯 收藏
          誰(shuí)沒(méi)有一些刻骨銘心事
          誰(shuí)能預(yù)計(jì)后果
          誰(shuí)沒(méi)有一些舊恨心魔
          一點(diǎn)點(diǎn)無(wú)心錯(cuò)
          誰(shuí)沒(méi)有一些得不到的夢(mèng)
          誰(shuí)人負(fù)你負(fù)我多
          誰(shuí)愿意解釋為了什么
          一笑已經(jīng)風(fēng)云過(guò)
          posted @ 2008-08-26 22:06 豬 閱讀(107) | 評(píng)論 (0)編輯 收藏
          一個(gè)周末,兩天,除了吃飯一動(dòng)不動(dòng)坐在家里寫代碼,坐的我屁股疼,腰疼,脖子疼,腦袋疼,眼睛疼....由于決策缺乏前瞻,之前買的一個(gè)報(bào)表共享控件不能滿足現(xiàn)在的新需求,其實(shí)原來(lái)也有,只是不知道這s控件干不了這活兒,求助作者接連幾天都沒(méi)回音。
          被迫將這該死的控件從系統(tǒng)中剝離,想別的辦法代替,本來(lái)第一種方案使用水晶報(bào)表的,研究了一晚上沒(méi)有進(jìn)展,放棄,主要是水晶報(bào)表畫格子太不方便了,也不知道是不是我沒(méi)找到良方,現(xiàn)在改用了word,在里面畫表格保存成模板,然后用程序填充數(shù)據(jù)。
          現(xiàn)在周末過(guò)完了,欣慰的是基本上舊的控件程序都剃掉了,換上了word模板,這樣最大的缺點(diǎn)就是速度,如果數(shù)據(jù)量大會(huì)很慢,還好,這是個(gè)小系統(tǒng),數(shù)據(jù)量不算大。
          準(zhǔn)備收工,洗個(gè)澡休息,明兒好上班,突然想起上來(lái)空間看看,發(fā)現(xiàn)訪問(wèn)量一萬(wàn)多了都,哈哈
          本來(lái)還想10000的時(shí)候抓個(gè)圖呢,一不小心,過(guò)了,呵呵
          posted @ 2008-08-26 22:06 豬 閱讀(122) | 評(píng)論 (0)編輯 收藏
          <html>
          <head>
              <title>彈出div</title>


             <style>
          .#floater {
          visibility: hidden;
          background-color: #f7fcfe;
          z-index: 100;
          width: 300px;
          height: 50px;
          position: absolute;
          text-align: center;
          font-size: 30px;
          color: #FF0000;
          font-weight: bold;
          vertical-align: middle;
          }
          </style>



          <script language="javaScript">
          function show()
          {
              var d_dialog = document.getElementById('dialog');
              d_dialog.style.top = document.body.clientHeight / 2 - 60;
              d_dialog.style.left =document.body.clientWidth / 2 -100;
              d_dialog.style.visibility='visible';
              init();
          }


          function divBlock_event_mousedown()
          {
              var e, obj, temp;
              obj=document.getElementById('dialog');
              e=window.event?window.event:e;
              obj.startX=e.clientX-obj.offsetLeft;
              obj.startY=e.clientY-obj.offsetTop;
              document.onmousemove=document_event_mousemove;
              temp=document.attachEvent?document.attachEvent('onmouseup',document_event_mouseup):document.addEventListener('mouseup',document_event_mouseup,'');
          }


          function document_event_mousemove(e)
          {
              var e, obj;
              obj=document.getElementById('dialog');
              e=window.event?window.event:e;
              with(obj.style){
                  position='absolute';
                  left=e.clientX-obj.startX+'px';
                  top=e.clientY-obj.startY+'px';
                  }
          }

          function document_event_mouseup(e)
          {
              var temp;
              document.onmousemove='';
              temp=document.detachEvent?document.detachEvent('onmouseup',document_event_mouseup):document.removeEventListener('mouseup',document_event_mouseup,'');
          }
          </script>
          <script language="JavaScript">
          self.onError=null;     
          currentX = currentY =0;     
          whichIt = null;     
          lastScrollX =-10; lastScrollY = -100;     
          NS = (document.layers) ? 1 : 0;     
          IE = (document.all) ? 1: 0;     
          <!-- STALKER CODE -->     
          function heartBeat() {     
              if(IE) { diffY = document.body.scrollTop; diffX = document.body.scrollLeft; }     
              if(NS) { diffY = self.pageYOffset; diffX = self.pageXOffset; }     
              if(diffY != lastScrollY) {     
                  percent = .1 * (diffY - lastScrollY);     


                  if(percent > 0) percent = Math.ceil(percent);     
                  else percent = Math.floor(percent);     
                  if(IE) document.all.dialog.style.pixelTop += percent;     
                  if(NS) document.dialog.top += percent;     
                  lastScrollY = lastScrollY + percent;     
              }     
              if(diffX != lastScrollX) {     
                  percent = .1 * (diffX - lastScrollX);     
                  if(percent > 0) percent = Math.ceil(percent);     
                  else percent = Math.floor(percent);     
                  if(IE) document.all.dialog.style.pixelLeft += percent;     
                  if(NS) document.dialog.left += percent;     
                  lastScrollX = lastScrollX + percent;     
              }     
          }     


          <!-- /STALKER CODE -->     
          <!-- DRAG Drop CODE -->     
          function checkFocus(x,y) {     
              stalkerx = document.dialog.pageX;     
              stalkery = document.dialog.pageY;     
              stalkerwidth = document.dialog.clip.width;     
              stalkerheight = document.dialog.clip.height;     
              if( (x > stalkerx && x < (stalkerx+stalkerwidth)) && (y > stalkery && y < (stalkery+stalkerheight))) return true;     
              else return false;     
          }     
          function grabIt(e) {     
              if(IE) {     
                  whichIt = event.srcElement;     
                  while (whichIt.id.indexOf("dialog") == -1) {     

                      whichIt = whichIt.parentElement;     
                      if (whichIt == null) { return true; }     
                  }     
                  whichIt.style.pixelLeft = whichIt.offsetLeft;     
                  whichIt.style.pixelTop = whichIt.offsetTop;     
                  currentX = (event.clientX + document.body.scrollLeft);     
                  currentY = (event.clientY + document.body.scrollTop);     
                  } else {     
                      window.captureEvents(Event.MOUSEMOVE);     
                      if(checkFocus (e.pageX,e.pageY)) {     
                          whichIt = document.dialog;     
                          StalkerTouchedX = e.pageX-document.dialog.pageX;     
                          StalkerTouchedY = e.pageY-document.dialog.pageY;     
                      }     
              }     


              return true;     
          }

          function moveIt(e) {     
          if (whichIt == null) { return false; }     
          if(IE) {     
          newX = (event.clientX + document.body.scrollLeft);     
          newY = (event.clientY + document.body.scrollTop);     
          distanceX = (newX - currentX); distanceY = (newY - currentY);     
          currentX = newX; currentY = newY;     
          whichIt.style.pixelLeft += distanceX;     
          whichIt.style.pixelTop += distanceY;     
          if(whichIt.style.pixelTop < document.body.scrollTop) whichIt.style.pixelTop = document.body.scrollTop;     
          if(whichIt.style.pixelLeft < document.body.scrollLeft) whichIt.style.pixelLeft = document.body.scrollLeft;     
          if(whichIt.style.pixelLeft > document.body.offsetWidth - document.body.scrollLeft - whichIt.style.pixelWidth - 20) whichIt.style.pixelLeft = document.body.offsetWidth - whichIt.style.pixelWidth - 20;     
          if(whichIt.style.pixelTop > document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5) whichIt.style.pixelTop = document.body.offsetHeight + document.body.scrollTop - whichIt.style.pixelHeight - 5;     
          event.returnValue = false;     
          } else {     
          whichIt.moveTo(e.pageX-StalkerTouchedX,e.pageY-StalkerTouchedY);     
          if(whichIt.left < 0+self.pageXOffset) whichIt.left = 0+self.pageXOffset;     
          if(whichIt.top < 0+self.pageYOffset) whichIt.top = 0+self.pageYOffset;     
          if( (whichIt.left + whichIt.clip.width) >= (window.innerWidth+self.pageXOffset-17)) whichIt.left = ((window.innerWidth+self.pageXOffset)-whichIt.clip.width)-17;     
          if( (whichIt.top + whichIt.clip.height) >= (window.innerHeight+self.pageYOffset-17)) whichIt.top = ((window.innerHeight+self.pageYOffset)-whichIt.clip.height)-17;     
          return false;     
          }     
          return false;     
          }     
          function dropIt() {     
          whichIt = null;     
          if(NS) window.releaseEvents (Event.MOUSEMOVE);     
          return true;     
          }     
          <!-- DRAG Drop CODE -->     
          if(NS) {     
          window.captureEvents(Event.MOUSEUP|Event.MOUSEDOWN);     
          window.onmousedown = grabIt;     
          window.onmousemove = moveIt;     
          window.onmouseup = dropIt;     
          }     
          if(IE) {     
          document.onmousedown = grabIt;     
          document.onmousemove = moveIt;     
          document.onmouseup = dropIt;     
          }     
          if(NS || IE) action = window.setInterval("heartBeat()",1);     
          </script>
          </head>
          <div id ="dialog" onmousedown="divBlock_event_mousedown()">在這里面定義html內(nèi)容美化</div>
          <body onload="show()">
              <table border='0' width="100%" height="100%">
                  <tr>
                      <td>
                          測(cè)試
                      </td>
                  </tr>
                  <tr>
                     <td>
                       處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>
                      處理中,請(qǐng)等待……<br>

                      <br>
                      <br>
                      <br>
                      <br>
                     </td>
                  </tr>
              </table>
          </body>
          </html>
          posted @ 2008-08-26 22:06 豬 閱讀(1661) | 評(píng)論 (1)編輯 收藏

          <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
          <HTML>
          <HEAD>
          <TITLE> New Document </TITLE>
          <style type="text/css">
          <!--

          .#opstatdiv {
             visibility: hidden;
             background-color: #f7fcfe;
             z-index: 100;
             width: 200px;
             height: 50px;
             position: absolute;
             text-align: left;
             font-size: 12px;
             color: #FF0000;
             font-weight: bold;
             vertical-align: middle;
          }
          -->
          </style>
          <script type="text/javascript">

          function showOpstatView()
          {
          var msgStr = "提示信息";
          var d_dialog = document.getElementById('opstatdiv');
          d_dialog.innerHTML = msgStr;
          d_dialog.style.posLeft = document.body.scrollLeft + event.clientX + 10;
          d_dialog.style.posTop = document.body.scrollTop + event.clientY;
            
          d_dialog.style.visibility='visible';

          }

          function opstatDivClose()
          {
              var d_dialog = document.getElementById('opstatdiv');
              d_dialog.style.visibility='hidden';
          }

          </script>
          </HEAD>

          <BODY>
          <div id="opstatdiv"></div>
          <table>
          <tr>
             <td onmouseover="javascript:showOpstatView()" onmouseout="javascript:opstatDivClose()">>
             靠近我
             </td>
          </tr>
          </table>
          </BODY>
          </HTML>

          posted @ 2008-08-26 22:06 豬 閱讀(452) | 評(píng)論 (0)編輯 收藏

          C#操作Word中的表格

                      object oMissing = System.Reflection.Missing.Value;
                      Microsoft.Office.Interop.Word._Application oWord;
                      Microsoft.Office.Interop.Word._Document oDoc;
                      oWord = new Microsoft.Office.Interop.Word.Application();
                      //顯示word文檔
                      oWord.Visible = true;
                      //取得word文件模板
                      object fileName = System.Windows.Forms.Application.StartupPath + "\\word.doc";
                      //根據(jù)模板生成一個(gè)新文檔,相當(dāng)于另存為
                      oDoc = oWord.Documents.Add(ref fileName, ref oMissing,
                                      ref oMissing, ref oMissing);
                      //在這里操作表格中的文本
                      oDoc.Tables[1].Cell(1, 1).Range.Text = "cell11";


                      //MessageBox.Show(oDoc.Content.Paragraphs[3].Range.Text);

          遇到的問(wèn)題

          1、開(kāi)始時(shí)添加word動(dòng)態(tài)鏈接庫(kù)引用出錯(cuò),在引用里面有黃色感嘆號(hào),在baidu上搜,找到原因,是因?yàn)?,先安裝的office,后安裝的.net,默認(rèn)沒(méi)有安裝.NET Programmability Support(.net可編程支持)。重新啟動(dòng)office安裝程序,選修復(fù),將.NET Programmability Support(.net可編程支持)選擇安裝到本機(jī)就OK了。

          參考:http://hi.baidu.com/devzhao/blog/item/4248624ab27e102008f7ef2c.html

          2、添加word引用的方法,在Program Files\Microsoft Office\OFFICE11中有個(gè)MSWORD.OLB文件,添加引用,就行了,還有中辦法好象在com組件中找到Microsoft Word 11.0 Object Library也行。

          3、操作word文檔的代碼參考:http://tmsoft.lsxy.com/index.php?load=read&id=334#comm_top

          另外,還不知道,這樣的代碼對(duì)客戶機(jī)配置有什么要求,office是肯定必須安裝了,安裝的版本有限制沒(méi),以后客戶自己升級(jí)個(gè)office 2007會(huì)不會(huì)有問(wèn)題????

          高手看到了,麻煩告訴小弟一下,謝過(guò)?。?!

          posted @ 2008-08-26 22:06 豬 閱讀(325) | 評(píng)論 (0)編輯 收藏
          vss for eclipse 顯示簽出狀態(tài)老是無(wú)緣無(wú)故沒(méi)了,還得每次到baidu上搜,這次記下來(lái)省得忘,呵呵
          posted @ 2008-08-26 22:06 豬 閱讀(139) | 評(píng)論 (0)編輯 收藏
          JPA(Java Persistence API)
          JPA(Java Persistence API)作為Java EE 5.0平臺(tái)標(biāo)準(zhǔn)的ORM規(guī)范,將得到所有Java EE服務(wù)器的支持。Sun這次吸取了之前EJB規(guī)范慘痛失敗的經(jīng)歷,在充分吸收現(xiàn)有ORM框架的基礎(chǔ)上,得到了一個(gè)易于使用、伸縮性強(qiáng)的ORM規(guī)范。
          posted @ 2008-08-26 22:06 豬 閱讀(136) | 評(píng)論 (0)編輯 收藏

          <%--

          /**

          *實(shí)現(xiàn)右鍵菜單功能

          */

          --%>

          <html>
              <body oncontextmenu = showMenu('')>
                  <form name = "menuForm">
                      <!--隱藏框,用來(lái)保存選擇的菜單的id值-->
                      <input type = "hidden" name = "id" value = "">
                      <table>
                      <tr>
                 <td><a href="javascript:clickMenu()" oncontextmenu = showMenu('0')>根目錄</a></td>
              </tr>
                      <tr>
                 <td><a href="javascript:clickMenu()" oncontextmenu = showMenu('1')>菜單一</a></td>
              </tr>

                      <tr><td><a href="javascript:clickMenu()" oncontextmenu = showMenu('2')>菜單二</a></td></tr>

                      </table>
                  </form>
              </body>

              <!-- 這里用來(lái)定義需要顯示的右鍵菜單 -->
              <div id="itemMenu" style="display:none">
                     <table border="1" width="100%" height="100%" bgcolor="#cccccc" style="border:thin" cellspacing="0">
                            <tr>
                                <td style="cursor:default;border:outset 1;" align="center" onclick="parent.create()">
                                新增
                                </td>
                            </tr>
                            <tr>
                                <td style="cursor:default;border:outset 1;" align="center" onclick="parent.update();">
                                修改
                                </td>
                            </tr>
                            <tr>
                                <td style="cursor:default;border:outset 1;" align="center" onclick="parent.del()">
                                刪除
                               </td>
                            </tr>
                     </table>
              </div>
              <!-- 右鍵菜單結(jié)束-->
          </html>


          <script language="JavaScript">

          /**

          *根據(jù)傳入的id顯示右鍵菜單

          */

          function showMenu(id){
              menuForm.id.value = id;

              if("" == id){
                  popMenu(itemMenu,100,"100");
              }
              else{
                  popMenu(itemMenu,100,"111");
              }

              event.returnValue=false;
              event.cancelBubble=true;
              return false;

          }


          /**

          *顯示彈出菜單

          *menuDiv:右鍵菜單的內(nèi)容

          *width:行顯示的寬度

          *rowControlString:行控制字符串,0表示不顯示,1表示顯示,如“101”,則表示第1、3行顯示,第2行不顯示

          */

          function popMenu(menuDiv,width,rowControlString){
              //創(chuàng)建彈出菜單
              var pop=window.createPopup();

              //設(shè)置彈出菜單的內(nèi)容
              pop.document.body.innerHTML=menuDiv.innerHTML;
              var rowObjs=pop.document.body.all[0].rows;

              //獲得彈出菜單的行數(shù)
              var rowCount=rowObjs.length;

              //循環(huán)設(shè)置每行的屬性
              for(var i=0;i<rowObjs.length;i++){
                  //如果設(shè)置該行不顯示,則行數(shù)減一
                  var hide=rowControlString.charAt(i)!='1';

                  if(hide){
                      rowCount--;
                  }

                  //設(shè)置是否顯示該行

                  rowObjs[i].style.display=(hide)?"none":"";

                  //設(shè)置鼠標(biāo)滑入該行時(shí)的效果

                  rowObjs[i].cells[0].onmouseover=function(){
                      this.style.background="#818181";
                      this.style.color="white";
                  }
                  //設(shè)置鼠標(biāo)滑出該行時(shí)的效果
                  rowObjs[i].cells[0].onmouseout=function(){
                      this.style.background="#cccccc";
                      this.style.color="black";
                  }

              }

              //屏蔽菜單的菜單
              pop.document.oncontextmenu=function() {
                      return false;
              }

              //選擇右鍵菜單的一項(xiàng)后,菜單隱藏
              pop.document.onclick=function(){
                      pop.hide();
              }
              //顯示菜單
              pop.show(event.clientX-1,event.clientY,width,rowCount*25,document.body);
              return true;

          }
          function create(){
              alert("create" + menuForm.id.value + "!");
          }

          function update(){
              alert("update" + menuForm.id.value + "!");
          }
          function del(){
              alert("delete" + menuForm.id.value + "!");
          }
          function clickMenu(){
              alert("you click a menu!");
          }
          </script>

          posted @ 2008-08-26 22:06 豬 閱讀(201) | 評(píng)論 (0)編輯 收藏
          用上百度Hi 的朋友加我好友啊,嘿嘿i

          在線等......
          posted @ 2008-08-26 22:06 豬 閱讀(119) | 評(píng)論 (0)編輯 收藏
          忙里偷閑
          研究了一下webservice,做了個(gè)hello world
          一點(diǎn)理解,xfire能把一個(gè)普通java類映射成web服務(wù)
          首先要建立一個(gè)供外部調(diào)用的接口interface
          然后建立一個(gè)類實(shí)現(xiàn)這個(gè)接口
          再然后在service.xml中配置web服務(wù)的名字,名稱空間,接口類名,實(shí)現(xiàn)接口的類名,這個(gè)service.xml文件要放在src/META-INF/xfire/services.xml
          最后在web.xml中配置xfire 的servlet
          OK了
          ===============接口HelloWorldService 類==================
          package com.capinfo.xfire.pojo;
          /**
          * @author sing
          * @explain:
          * @datetime:Mar 26, 2008 4:48:19 PM
          */

          public interface HelloWorldService {

              public String sayHello();
             
          }
          ==============接口實(shí)現(xiàn)類HelloWorldServiceImpl =====================
          package com.capinfo.xfire.pojo;
          /**
          * @author sing
          * @explain:
          * @datetime:Mar 26, 2008 4:50:15 PM
          */
          public class HelloWorldServiceImpl implements HelloWorldService {

              public String sayHello() {
                 
                  return "this.is.my first web service";
              }

          }
          ===============service.xml==================
          <?xml version="1.0" encoding="UTF-8"?>
          <beans xmlns="http://xfire.codehaus.org/config/1.0">
          <service>
              <name>HelloWorldService</name>
              <namespace>http://capinfo.com/HelloWorldService</namespace>
              <serviceClass>
                  com.capinfo.xfire.pojo.HelloWorldService
              </serviceClass>
              <implementationClass>
                  com.capinfo.xfire.pojo.HelloWorldServiceImpl
              </implementationClass>
          </service>
          </beans>
          ==============web.xml=======================
          <?xml version="1.0" encoding="UTF-8"?>
          <web-app version="2.4"
              xmlns="http://java.sun.com/xml/ns/j2ee"
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
              xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
              http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

              <servlet>
                  <servlet-name>XFireServlet</servlet-name>
                  <display-name>XFire Servlet</display-name>
                  <servlet-class>
                      org.codehaus.xfire.transport.http.XFireConfigurableServlet
                  </servlet-class>
              </servlet>
             
              <servlet-mapping>
                  <servlet-name>XFireServlet</servlet-name>
                  <url-pattern>/servlet/XFireServlet/*</url-pattern>
              </servlet-mapping>

              <servlet-mapping>
                  <servlet-name>XFireServlet</servlet-name>
                  <url-pattern>/services/*</url-pattern>
              </servlet-mapping>
          <welcome-file-list>
              <welcome-file>index.jsp</welcome-file>
          </welcome-file-list>
          </web-app>
          ===================Test.java========================
          package com.capinfo.xfire.pojo;

          import java.net.MalformedURLException;

          import org.codehaus.xfire.client.XFireProxyFactory;
          import org.codehaus.xfire.service.Service;
          import org.codehaus.xfire.service.binding.ObjectServiceFactory;

          /**
          * @author spring
          * @explain:
          * @datetime:Mar 26, 2008 5:50:02 PM
          */
          public class Test {

              public static void main(String [] args){
                  Service serviceModel = new ObjectServiceFactory().create(HelloWorldService.class);
                  try {
                      HelloWorldService service = (HelloWorldService)
                          new XFireProxyFactory().create(serviceModel, "http://localhost:8081/xfire/services/HelloWorldService");
                      System.out.println(service.sayHello());
                  } catch (MalformedURLException e) {
                      e.printStackTrace();
                  }
              }
          }

          ======================放jar包========================
          "activation-1.1.jar"
          "commons-codec-1.3.jar"
          "commons-httpclient-3.0.jar"
          "commons-logging-1.0.4.jar"
          "jaxen-1.1-beta-9.jar"
          "jdom-1.0.jar"
          "mail-1.4.jar"
          "spring-1.2.6.jar"
          "stax-api-1.0.1.jar"
          "wsdl4j-1.6.1.jar"
          "wstx-asl-3.2.0.jar"
          "xbean-spring-2.8.jar"
          "xfire-all-1.2.6.jar"


          參考資源:http://www.aygfsteel.com/fastzch/archive/2008/01/03/172535.html
          posted @ 2008-08-26 22:06 豬 閱讀(289) | 評(píng)論 (0)編輯 收藏
          僅列出標(biāo)題
          共27頁(yè): First 上一頁(yè) 5 6 7 8 9 10 11 12 13 下一頁(yè) Last 

          公告

          希望有一天

          我能用鼠標(biāo)雙擊我的錢包

          然后選中一張100元

          按住“ctrl+c”

          接著不停的“ctrl+v”

          嘻嘻~~~笑醒~~~



          導(dǎo)航

          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          統(tǒng)計(jì)

          常用鏈接

          留言簿(6)

          隨筆分類(102)

          隨筆檔案(398)

          文章分類

          文章檔案(10)

          有趣網(wǎng)絡(luò)

          搜索

          積分與排名

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          主站蜘蛛池模板: 灵台县| 镇江市| 搜索| 尚义县| 福建省| 东城区| 大连市| 永城市| 武邑县| 社旗县| 云梦县| 平凉市| 沧源| 凤山市| 安岳县| 井研县| 谢通门县| 黄陵县| 沧源| 大同县| 沐川县| 内黄县| 汤原县| 扎兰屯市| 玉树县| 昌都县| 平江县| 土默特左旗| 建德市| 称多县| 郑州市| 南昌县| 临清市| 株洲县| 兴和县| 武陟县| 黔西| 根河市| 建德市| 汝南县| 龙门县|