隨筆 - 16, 文章 - 0, 評論 - 0, 引用 - 0
          數據加載中……

          2011年12月12日

          springJDBCTemple能查詢不能更新

          這個問題實在是太sui了,就因為不知道什么時候把dataSource的配置寫成<property name="defaultAutoCommit" value="false" />
          所以,所以,,媽的,改true就好了。。。

          posted @ 2012-03-21 11:38 yita 閱讀(309) | 評論 (0)編輯 收藏

          mysql insert時報Duplicate entry...for key..

          @import url(http://www.aygfsteel.com/CuteSoft_Client/CuteEditor/Load.ashx?type=style&file=SyntaxHighlighter.css);@import url(/css/cuteeditor.css); Duplicate entry...for key..的意思時重復的鍵值,檢查主鍵或者其他唯一鍵值重復。

          posted @ 2012-03-20 20:08 yita 閱讀(332) | 評論 (0)編輯 收藏

          Install DB2 on LION


          先下載DB2 Express-c for mac 

          下載地址:

          https://www14.software.ibm.com/webapp/iwm/web/reg/download.do?source=swg-db2expressc&S_PKG=dlmacosx&S_TACT=100KG31W&lang=en_US&cp=UTF-8


          有兩個文件,一個是Express-C free db,一個是 Client。最好選擇直接下載而不要使用download director,ibm這個下載器真心一個爛。

          下載的時候順手搜了下,stackoverflow上有說lion下安裝有問題,原因是db2setup無法正確識別出系統構架x86_64

          解決方法是先使用uname -m 查系統構架。

          再修改db2setup腳本如下

          "Darwin")

              case ${OSM?} in

                i*86)

                    INSTALLDIR="${PROGDIR?}/db2/macos/install"

                    PLATNAME="MacOS" ;;

                x86_64)

                    INSTALLDIR="${PROGDIR?}/db2/macos/install"

                    PLATNAME="MacOS/x86_64" ;;

              esac ;;

          "HP-UX")

          原文地址 http://stackoverflow.com/questions/7072871/how-do-i-install-ibm-db2-express-c-on-mac-os-x-10-7-lion


          不過我下載下來的并沒有這個問題,i*86默認改為*86*了,不知道是我只安裝client還是ibm已經修正這個bug了?
          但是安裝的時候亂碼,我就直接執行db2install,很快就安裝結束,提示

          必須設置 DB2 實例環境

                ,其方法是:在 sqllib 目錄中查找 db2profile 或 db2cshrc,也可以對 

                DB2 實例用戶打開新的登錄窗口。



          未完待許。。



          posted @ 2012-03-08 14:28 yita 閱讀(527) | 評論 (0)編輯 收藏

          泛型方法

          public static <T> void add(Info<T> i1, Info<T> i2){
          返回值前的<T>是泛型方法的聲明方式,不加編譯錯誤。

          posted @ 2012-02-28 22:50 yita 閱讀(207) | 評論 (0)編輯 收藏

          mac快捷鍵以及增加桌面

           ⌘=CMD;⌥=OPT;^=Ctrl;⇧=Shift; ⎋=Esc;⌫=Del 

          新增桌面 ,觸控板四指向下,或者按F3 打開Mission Control 點右上角點擊+號。
          然后把不同程序按需要拖動到不同桌面即可。

          mac里command與win得ctrl功能差不多。不少快捷鍵也相似可以嘗試。

          posted @ 2012-02-13 11:23 yita 閱讀(2600) | 評論 (0)編輯 收藏

          mac下使用eclipse的svn報錯問題

           Failed to load JavaHL Library.
              These are the errors that were encountered:
              no libsvnjavahl-1 in java.library.path
              no svnjavahl-1 in java.library.path
              no svnjavahl in java.library.path
              java.library.path = ********
          

           eclipse裝好svn插件之后報加載JavaHL libary錯誤,看了一對說是要加參數指定 java.library.path。加了之后發現沒用,又搜了搜找到這個

            http://subclipse.tigris.org/wiki/JavaHL

          其中mac os 里有段寫到

          The easiest thing to do is download and install the OSX package that is provided on openCollabNet. This installs Subversion, including the JavaHL library, into /opt/subversion. 

          于是在http://www.open.collab.net/downloads/community/下載之,下載需要先注冊,找到10.7版的。再開開eclipse,同步svn就沒有問題

           

          ps.在sinaapp上看到介紹svnx這個客戶端,紀錄下,有時間試試

          posted @ 2012-01-10 10:49 yita 閱讀(2041) | 評論 (0)編輯 收藏

          Struts2 注解基礎

          The Struts dispatcher cannot be found.  This is usually caused by using Struts tags without the associated filter. Struts tags are only usable when the request has passed through its servlet filter, which initializes the Struts dispatcher needed for this tag. - [unknown location]

          先是報這個錯,因為struts2的filter是*.action的原因。改為以下即可。

          <filter-mapping>
          <filter-name>struts2Filter</filter-name>
          <url-pattern>/*</url-pattern>
          <dispatcher>REQUEST</dispatcher>
          <dispatcher>FORWARD</dispatcher>
          </filter-mapping>

           

          1.convention plugin插件

          convention plugin默認result頁面存放在WEB-INF/content.(可以通過struts.convention.result.path屬性來設置)。

          如 http://localhost:8080/hello-world該url將訪問WEB-INF/content/hello-world.jsp。

          2.convention plugin查找類的規則

              convention plugin會查找struts、struts2、action、actions等包里的滿足以下條件的類(好像可以設置)

          • 實現或繼承com.opensymphony.xwork2.Action、ActionSupport的類。
          • 或者action結尾的類名
            修改包查找規則修改下面兩個屬性
          <constant name="struts.convention.package.locators" value="test" />
          <constant name="struts.convention.package.locators.basePackage" value="com.test" />

          3.convention plugin類對應URL規則

            在struts、struts2、action、actions等包下生成“/”,更深層次則繼續以“包名/”,類名子目全小寫,按駝峰法分隔單詞添加“-”。舉例如下:

          com.example.actions.MainAction -> /main
          com.example.actions.products.Display -> /products/display
          com.example.struts.company.details.ShowCompanyDetailsAction -> /company/details/show-company-details

          4.result對應頁面名稱

            頁面命名與類名規則相同,再加上“-”與result值即可,如果找不到result的頁面,似乎會返回到省略result名稱的頁面,還有success可省略,如下:

          URLResultFile that could matchResult Type
          /hello success /WEB-INF/content/hello.jsp Dispatcher
          /hello success /WEB-INF/content/hello-success.htm Dispatcher
          /hello success /WEB-INF/content/hello.ftl FreeMarker
          /hello-world input /WEB-INF/content/hello-world-input.vm Velocity
          /test1/test2/hello error /WEB-INF/content/test/test2/hello-error.html Dispatcher


          5.chaining

            例子:foo action找不到result頁面,會自動查找foo-bar action

          package com.example.actions;

          import com.opensymphony.xwork2.Action;
          import com.opensymphony.xwork2.ActionSupport;

          public class HelloAction extends ActionSupport {
          @Action("foo")
          public String foo() {
          return "bar";
          }

          @Action("foo-bar")
          public String bar() {
          return SUCCESS;
          }
          }

           

           

            

            

           

           

           

           

          參考:

          struts2 convention-plugin文檔

          http://www.vaannila.com/struts-2/struts-2-example/struts-2-annotation-example-1.html

          http://apps.hi.baidu.com/share/detail/48320875

          posted @ 2011-12-30 20:14 yita 閱讀(208) | 評論 (0)編輯 收藏

          vim的一些配置。

          vimrc里加上下面代碼就可以ctrl+c、ctrl+v、ctrl+a等windows操作

          1 source $VIMRUNTIME/mswin.vim
          2 behave mswin

           

          解決亂碼問題

          " 設定默認解碼
          set encoding=utf-8
          set fileencodings=utf-8,chinese,latin-1
          if has("win32")
          "set fileencoding=chinese
          set fileencoding=utf-8
          else
          set fileencoding=utf-8
          endif
          language message zh_CN.utf-8
          "解決菜單亂碼
          source $VIMRUNTIME/delmenu.vim
          source $VIMRUNTIME/menu.vim
          "set font
          "set guifont=Nsimsun
          set guifont=Fixedsys:cGB2312

           

          最近用了這個vimrc(  http://amix.dk/vim/vimrc.html),據說是最強配置,去了個command—T(要裝ruby),里面還有不少插件得自己找。看了下主要是python和js的配置,回頭得再加點java的。

          順便得加上這個函數

          fun! MySys()
          return "windows"
          endfun




          posted @ 2011-12-20 12:05 yita 閱讀(203) | 評論 (0)編輯 收藏

          IE6的modaldialog里href運行javascript的錯誤解決方法

          IE6中用modaldialog時,a的href里寫javascript時,如<a href="javascript:test();">test</a>,如果無效或者出錯時,加上<base target="_self">即可。

          posted @ 2011-12-19 20:33 yita 閱讀(180) | 評論 (0)編輯 收藏

          現在項目的一些問題小記

          系統中戶人、育齡婦女、子女三個表有大量冗余,設計者稱所謂方便查詢和效率,結果為了保證數據的一致性付出了巨大的代價。記之。

          posted @ 2011-12-12 10:41 yita 閱讀(177) | 評論 (0)編輯 收藏

          主站蜘蛛池模板: 会宁县| 青龙| 峨山| 山东省| 迁西县| 宁陵县| 武强县| 翁源县| 化德县| 大冶市| 开平市| 常德市| 平顶山市| 岑溪市| 祁东县| 汉寿县| 枞阳县| 石首市| 岱山县| 镇沅| 临汾市| 罗甸县| 夏津县| 塔河县| 纳雍县| 沈丘县| 宁安市| 江安县| 太湖县| 弥渡县| 孟村| 闽侯县| 织金县| 大埔区| 舞阳县| 普兰县| 景泰县| 宣化县| 依兰县| 桐乡市| 右玉县|