posts - 11,  comments - 14,  trackbacks - 0
            2006年12月31日
          一、el
          var el =Ext.get('例如:formname');
          var map = new Ext.KeyMap(el, {
          key: Ext.EventObject.ENTER,
          fn: function(){
          event.keyCode=9;
          }
          });

          二、EditGrid,需修改源碼
          onEditorKey:function (F, E) {
           var C = E.getKey(), G, D = this.grid, B = D.activeEditor;
           var A = E.shiftKey;
           if (C == E.TAB) {
            E.stopEvent();
            B.completeEdit();
            if (A) {
             G = D.walkCells(B.row, B.col - 1, -1, this.acceptsNav, this);
            } else {
             G = D.walkCells(B.row, B.col + 1, 1, this.acceptsNav, this);
            }
           } else {
            if (C == E.ENTER) {
             E.stopEvent();
             B.completeEdit();
             if (this.moveEditorOnEnter !== false) {
              if (A) {
               //G = D.walkCells(B.row - 1, B.col, -1this.acceptsNav,this)
               G = D.walkCells(B.row, B.col - 1, -1, this.acceptsNav, this);
              } else {
               // G = D.walkCells(B.row + 1, B.col, 1this.acceptsNav,this)
               G = D.walkCells(B.row, B.col + 1, 1, this.acceptsNav, this);
              }
             }
            } else {
             if (C == E.ESC) {
              B.cancelEdit();
             }
            }
           }
           if (G) {
            D.startEditing(G[0], G[1]);
           }
          }

          posted @ 2008-08-24 12:14 jinn 閱讀(2714) | 評論 (4)編輯 收藏
               摘要: Webservice交互中需要雙方約定數據格式,用XML表示數據庫記錄是不錯的選擇。 先定義個DTD: <!--      DTD for the Xml-Format-String used to transmit business data --> <!-- The "DBSET" element is the root of...  閱讀全文
          posted @ 2008-07-18 15:13 jinn 閱讀(2054) | 評論 (1)編輯 收藏
          Webservice交互經常需要驗證用戶,用戶名和密碼的傳遞采用SOAPHeader傳遞不失為一種好辦法。在Axis1中設置很簡單:
          客戶端:
          ((org.apache.axis.client.Call) call).addHeader(new SOAPHeaderElement("Authorization","username",username));
          ((org.apache.axis.client.Call) call).addHeader(new SOAPHeaderElement("Authorization","password",password));

          經包裝后傳遞的內容如下
          <soapenv:Header>
            <ns1:username
             soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
             soapenv:mustUnderstand="0" xsi:type="soapenc:string"
             xmlns:ns1="Authorization"
             xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
             admin
            </ns1:username>
            <ns2:password
             soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next"
             soapenv:mustUnderstand="0" xsi:type="soapenc:string"
             xmlns:ns2="Authorization"
             xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">
             1
            </ns2:password>
           </soapenv:Header>

          服務端通過Handler取得用戶名和密碼進行驗證:
          username = (String) messageContext.getRequestMessage().getSOAPEnvelope()
          .getHeaderByName("Authorization","username").getValue();
          password = (String) messageContext.getRequestMessage().getSOAPEnvelope()
          .getHeaderByName("Authorization","password").getValue();

          如果覺得這樣不安全,可雙方約定一種加密解密規則,將用戶名和密碼加密后進行傳輸。

          我曾試過使用如下方法,
          客戶端:
          ((org.apache.axis.client.Call) call).setUsername(username);
          ((org.apache.axis.client.Call) call).setPassword(password);

          包裝后傳遞內容(多了最后一句:Authorization: Basic emphZG1pbjox。Axis將用戶名和密碼經Base64加密后傳遞):
          POST /web/services/GenericServer HTTP/1.0
          Content-Type: text/xml; charset=utf-8
          Accept: application/soap+xml, application/dime, multipart/related, text/*
          User-Agent: Axis/1.4
          Host: localhost:8083
          Cache-Control: no-cache
          Pragma: no-cache
          SOAPAction: ""
          Content-Length: 807
          Authorization: Basic emphZG1pbjox

          服務端的Handle:
          username =messageContext.getUsername();
          password = messageContext.getPassword();

          這樣是沒問題,看起來更簡單。可惜調用部署在weblogic上的ws時,會被weblogic攔截,必須在weblogic安全域中配置相應的用戶才能通過驗證,這不是我們所需要的,通常我們有自己的用戶管理機制,調用WS的用戶也作為系統中的一個用戶納入我們的管理,而不是跟weblogic安全域用戶綁在一起。

          posted @ 2008-07-18 13:18 jinn 閱讀(5937) | 評論 (1)編輯 收藏
               摘要: Jacob的下載、配置就不說了,提醒下,官方的提供的17版本似乎不支持jdk1.5,得下載19版的(CSDN上有)。 研究這個的目的是想用java生成符合格式的word文檔,文檔內容大體上有三種格式,Heading1、Heading2和Normal,在word的文檔結構圖顯示的樣子如下 Heading 1    Heading 2    H...  閱讀全文
          posted @ 2008-07-18 11:21 jinn 閱讀(4684) | 評論 (4)編輯 收藏
               摘要: 2007,也許會有危險,也許會有障礙,所以......  閱讀全文
          posted @ 2006-12-31 15:18 jinn 閱讀(363) | 評論 (0)編輯 收藏
          <2006年12月>
          262728293012
          3456789
          10111213141516
          17181920212223
          24252627282930
          31123456

          常用鏈接

          留言簿(3)

          隨筆分類

          文章分類

          相冊

          網站鏈接

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 正宁县| 霸州市| 长宁区| 昌平区| 闵行区| 桦甸市| 洪洞县| 巢湖市| 正定县| 读书| 铜梁县| 石渠县| 建德市| 大化| 兴安县| 漳平市| 望奎县| 富顺县| 南昌市| 娄底市| 乌鲁木齐市| 镇雄县| 益阳市| 宜君县| 塘沽区| 隆回县| 北京市| 阿尔山市| 秭归县| 嵩明县| 开阳县| 洱源县| 越西县| 周口市| 淳安县| 涿鹿县| 文昌市| 建阳市| 宜兰市| 易门县| 盐城市|