隨筆-11  評論-0  文章-2  trackbacks-0
            2012年5月3日
          1. <%  
          2. WebApplicationContext context = (WebApplicationContext)this.getServletContext().getAttribute(WebApplicationContext.ROOT_WEB_APPLICATION_CONTEXT_ATTRIBUTE);  
          3. TestService service = (TestService)context.getBean("testService");  
          4. %> 
          posted @ 2013-08-08 14:48 邦 閱讀(205) | 評論 (0)編輯 收藏

          一、模版修改

          在導出表時,powerdesigner默認為我們提供了很多的模版,在工具欄中選擇【Report--->Report Template】即可看到所有的默認模版。如圖一:

          圖一 模版列表

          這里我們為了導出powerdesigner中創建的表,在工具欄中選擇【Report--->Reports】(快捷鍵Ctrl+E),然后創建一個New Report,如下圖二所以,選擇Standard Physical Report,這里選擇的標準的模版,點擊OK確定。

          圖二 創建新的Report

          從工具欄【Report--->Print Preview】或者點擊圖標同樣可以預覽導出到word的效果了。效果如圖三所示:

          圖三 導出到word中預覽效果

          從【圖三】中的工具欄里面HTM和RTF兩種導出格式。如果導出到word選擇RTF格式即可,但是我們從【圖三】中看出紅色標出的部分,1 是word的頁眉,同樣還有頁腳信息 ,2 是一些列的屬性清單。

                                            

          圖四 設置頁眉、頁腳

          在【圖四】中,選擇Header/Footer后,刪掉Header里面的%MODULE% %MODELNAME%,刪掉Footer里面的%APPNAME% %DATE% 頁數 %PAGE%,User_defined footer就會自動勾上,這樣就去掉了頁眉、頁腳了

           

          還有其他的比如表前面的自增序號,第一頁中的創建者、版本、日期信息也不需要,我們可以進行配置去掉,如下【圖五】【圖六】

                                          

                                                        圖四 

           

                                                        圖五 Properties配置

          在圖五中,在默認配置中(General)勾上No paragraph numbering即可取消表前面的自增序號,在Title Page中選擇 No Title Page就不會生成第一頁中關于創建者、版本、日期等信息。

          在【圖三】中,預覽看到的內容太多,就必須刪除一些我們不需要的內容,經過刪減之后,如下【圖六】所示

          圖六 

          在【圖六】中右鍵單擊【List of Table Columns - 表<%PARENT%>列說明】,從菜單中選擇 Edit Title...,就可以編輯成現在我們已看到的。然后,在右鍵菜單中選擇Layout...,選擇我們所需要顯示的內容,Code表示列名稱,一般用英文單詞或拼音字母表示,Name一般用中文描述,Data Type 表示數據類型,Comment表示字段備注或字段說明等。

          到此基本上已經完成了powerdesigner模版的修改

          二、導出表

          然后點擊[Report---->Generate RTF]導出到word中,最后我們看看導出到word的效果,如下圖:

          圖七 導出到word效果

          三、保存模版

                通過上文,我們完成了自己所需的模版,然后就保存,以后可以直接使用即可,在工具欄中[Report--->Create Template From Section],然后Ctrl+S就會要求保存,取名保存即可。

          posted @ 2012-09-24 18:12 邦 閱讀(586) | 評論 (0)編輯 收藏
           /Files/bang/Maven3應用入門講座.pptx
          posted @ 2012-08-22 10:31 邦 閱讀(263) | 評論 (0)編輯 收藏
          用jTDS通過JDBC連:
          <dependency>
          <groupId>net.sourceforge.jtds</groupId>
          <artifactId>jtds</artifactId>
          <version>1.2.4</version>
          </dependency>

          public static List<String> executeQuery(String sql,String columns) {

                  try {
                      Connection conn = getConnection();
                      Statement st = conn.createStatement();
                      ResultSet set = st.executeQuery(sql);
                      List<String> result = new ArrayList<String>();
                      while (set.next()) {
                          String[] columnList = columns.split(",");
                          for(String str:columnList){
                              result.add(set.getString(str));
                          }
                         
                      }
                      set.close();
                      st.close();
                      conn.close();
                      return result;
                  } catch (SQLException e) {
                      throw new IllegalArgumentException(e);
                  }
              }

              public static Connection getConnection() {
                  try {
                      Class.forName("net.sourceforge.jtds.jdbc.Driver");
                      String url = "jdbc:jtds:sqlserver://localhost:1433;DatabaseName=jdl";
                      String username = "sa";
                      String password = "";
                      Connection conn = DriverManager.getConnection(url, username,
                      password);
                      return conn;
                  } catch (Exception e) {
                      throw new IllegalArgumentException(e);
                  }
              }

          posted @ 2012-08-02 15:55 邦 閱讀(5153) | 評論 (0)編輯 收藏
          在js中的url進行encodeURIComponent編碼:dd_ddtj_sub.jsp?shrxm="+encodeURIComponent(shrxm1)+"&lxdh="+encodeURIComponent(lxdh1)
          后臺service進行encode編碼和decode解碼:shrxm= java.net.URLEncoder.encode(shrxm, "UTF-8");
            shrxm= java.net.URLDecoder.decode(shrxm,"UTF-8");
          posted @ 2012-07-11 17:01 邦 閱讀(278) | 評論 (0)編輯 收藏

          1)、下載MongoDB
          http://downloads.mongodb.org/win32/mongodb-win32-i386-2.0.4.zip

          2)、設置MongoDB目錄

          將其解壓到 d:\,再重命名為mongodb,路徑為d:\mongodb

          3)、設置數據文件路徑

          d:盤建一個data文件夾,在data文件夾中新建db文件夾,路徑d:\data\db

          4)、啟動MongoDB服務

          進入 cmd 提示符控制臺,
          D:\mongodb\bin\mongod.exe --dbpath=d:\data\db

          <!--[if !supportLists]-->1.  <!--[endif]-->Mon Apr 16 08:50:54
          <!--[if !supportLists]-->2.  <!--[endif]-->Mon Apr 16 08:50:54 warning: 32-bit servers don't have journaling enabled by def
          <!--[if !supportLists]-->3.  <!--[endif]-->ault. Please use --journal if you want durability.
          <!--[if !supportLists]-->4.  <!--[endif]-->Mon Apr 16 08:50:54
          <!--[if !supportLists]-->5.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] MongoDB starting : pid=5084 port=27017 dbpat
          <!--[if !supportLists]-->6.  <!--[endif]-->h=d:\data\db 32-bit host=PC-201012302214
          <!--[if !supportLists]-->7.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten]
          <!--[if !supportLists]-->8.  <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] ** NOTE: when using MongoDB 32 bit, you are
          <!--[if !supportLists]-->9.  <!--[endif]-->limited to about 2 gigabytes of data
          <!--[if !supportLists]-->10. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] **       see http://blog.mongodb.org/post/13
          <!--[if !supportLists]-->11. <!--[endif]-->7788967/32-bit-limitations
          <!--[if !supportLists]-->12. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] **       with --journal, the limit is lower
          <!--[if !supportLists]-->13. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten]
          <!--[if !supportLists]-->14. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] db version v2.0.4, pdfile version 4.5
          <!--[if !supportLists]-->15. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] git version: 329f3c47fe8136c03392c8f0e548506
          <!--[if !supportLists]-->16. <!--[endif]-->cb21f8ebf
          <!--[if !supportLists]-->17. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] build info: windows sys.getwindowsversion(ma
          <!--[if !supportLists]-->18. <!--[endif]-->jor=6, minor=0, build=6002, platform=2, service_pack='Service Pack 2') BOOST_LIB
          <!--[if !supportLists]-->19. <!--[endif]-->_VERSION=1_42
          <!--[if !supportLists]-->20. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] options: { dbpath: "d:\data\db" }
          <!--[if !supportLists]-->21. <!--[endif]-->Mon Apr 16 08:50:54 [websvr] admin web console waiting for connections on port 2
          <!--[if !supportLists]-->22. <!--[endif]-->8017
          <!--[if !supportLists]-->23. <!--[endif]-->Mon Apr 16 08:50:54 [initandlisten] waiting for connections on port 27017

          MongoDB服務端的默認連接端口:27017

          5)、將MongoDB作為 Windows 服務隨機啟動

          先創建D:\mongodb\logs\mongodb.log文件,用于存儲MongoDB的日志文件, 再安裝系統服務:
                
          D:\mongodb\bin\mongod --dbpath=d:\data\db --logpath=d:\mongodb\log

          s\mongodb.log --install   
          all output going to: d:\mongodb\logs\mongodb.log  
          Creating service MongoDB.  
          Service creation successful.  
          Service can be started from the command line via 'net start "MongoDB"'.
          D:\>net start mongodb  
          Mongo DB 
          服務已經啟動成功。  
          D:> 
          注意:如果需要卸載服務,執行命令:sc delete MongoDB

          6)、客戶端連接驗證

          新打開一個CMD輸入:d:\mongodb\bin\mongo,如果出現下面提示,那么您就可以開始MongoDB之旅了:

          <!--[if !supportLists]-->1.  <!--[endif]-->d:\mongodb\bin\mongo  
          <!--[if !supportLists]-->2.  <!--[endif]-->MongoDB shell version: 2.0.4  
          <!--[if !supportLists]-->3.  <!--[endif]-->connecting to: test  
          <!--[if !supportLists]-->4.  <!--[endif]-->> 

          7)、查看MongoDB日志

          查看D:\mongodb\logs\mongodb.log文件,即可對MongoDB的運行情況進行查看或排錯。

          posted @ 2012-07-10 13:24 邦 閱讀(639) | 評論 (0)編輯 收藏

          方案一:

          希望實現 當鼠標離開一個DIV的時候觸發一個事件處理函數 于是用onmouseout 結果卻發現它的觸發是不是也太敏感了 原因現在也沒有弄清楚 IE下好像是因為區分mouseout時的fromElement還是toElement ,IE 5.5以上的onmouseleave事件就比較好用 偏FF又不支持這個事件 只有自己想辦法手工判斷了。
          <SCRIPT>
          /***
          * 參數e 是對象傳遞的觸發事件 FF下想訪問event對象必須傳遞event參數
          * 參數o 是目標DIV對象
          */  
          function fun(e,o) {
                  /* FF 下判斷鼠標是否離開DIV */
                  if(window.navigator.userAgent.indexOf("Firefox")>=1) {
                      var x = e.clientX + document.body.scrollLeft;
                      var y = e.clientY + document.body.scrollTop ;
                      var left = o.offsetLeft;
                      var top = o.offsetTop;
                      var w = o.offsetWidth;
                      var h = o.offsetHeight;
                     
                      if(y < top || y > (h + top) || x > left + w || x<left ) {
                          alert("mouseout");
                      }
                  }

                  /* IE */
                  if(o.contains(event.toElement ) == false    )
          alert("mouseout");
                 
              }
          </SCRIPT>

          <DIV onmouseout=fun(event,this)>content</DIV>


          需要注意 在取鼠標的值的時候 一定要加上滾動條已經拖動過的內容e.clientY + document.body.scrollTop 如果只是e.clientY得到是個錯誤的值 當然如果高寬都很小 是看不出來問題。 取一個對象的高和寬 也可以使用 clientHeight clientWidth 屬性 以后遇到FF IE不兼容的時候要多看看FF的開發手冊 http://developer.mozilla.org/en/docs/DOM:element.offsetLeft

           

           

          方案二:(與一相似)

          js的onmouseout有很奇怪的一個問題。例如

          <div onmouseout="alert(123)">

          <a href="#">test</a>

          </div>

          我們預期只有當鼠標從div中移開的時候才會觸發onmouseout事件,可是,事實上,當我們移到div中的元素時,例如本例中的a標簽時,就會觸發onmousout事件。也就是說,移到對象的子對象上,也算onmouseout了。這往往會讓我們預期的效果達不到。今天的工作就遇到了這個問題。在blueidea上搜了一下,找了解決辦法。兼容IE和FF。

           

          復制代碼
          <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
          <html xmlns="http://www.w3.org/1999/xhtml">
          <head>
          <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
          <title>阿當制作</title>
          </head>

          <body>
          <script type="text/javascript">
          function test(obj, e) {
          if (e.currentTarget) {
          if (e.relatedTarget != obj) {
          if (obj != e.relatedTarget.parentNode) {
          alert(
          1);
          }
          }
          }
          else {
          if (e.toElement != obj) {
          if (obj != e.toElement.parentNode) {
          alert(
          1);
          }
          }
          }
          }
          </script>
          <div onmouseout="test(this, event)" style="width:100px;height:100px;border:1px #666 solid">
          <span style="margin:5px;width:100%;height:100%;border:1px #ff0000 solid">faddsf</span>
          </div>
          </body>
          </html>

          復制代碼

           

          
          

           

          今天發現JQ中關于這個問題,已經有了一個好的解決辦法了.呵呵,jquery中定義了一種事件叫做"mouseleave",用這個事件做事件句柄的話,就可以解決這個問題了.越來越發現jquery是個好東西了.

           

          方案三:

          ,jQuery V1.2.2推薦用bind("mouseleave",function(){})來代替以前的mouseover方法
          用bind("mouseenter",function(){})來代替mouseout,同樣也針對以前的hover方法,要看詳細的說明點這個地址:http://docs.jquery.com/Release:jQuery_1.2.2

          $(document).ready(function() {
             $("#a1").bind("mouseleave", function(){
             $('<div style="color:red;">out</div>')
             .insertAfter($(this));
          });
          });

          posted @ 2012-05-03 16:08 邦 閱讀(239) | 評論 (0)編輯 收藏
          主站蜘蛛池模板: 丰都县| 大城县| 石台县| 桓台县| 南溪县| 沧源| 突泉县| 江北区| 扬州市| 罗平县| 新竹县| 阿勒泰市| 乐平市| 常州市| 方正县| 铜山县| 肇东市| 明光市| 东台市| 东阿县| 玛沁县| 黑山县| 乌拉特后旗| 永年县| 旬阳县| 宜阳县| 满城县| 剑河县| 辽源市| 盐津县| 苏州市| 察隅县| 南昌县| 利川市| 图们市| 莱西市| 项城市| 盈江县| 昌吉市| 阜城县| 巴马|