隨筆 - 16, 文章 - 0, 評(píng)論 - 0, 引用 - 0
          數(shù)據(jù)加載中……

          2011年12月20日

          springJDBCTemple能查詢(xún)不能更新

          這個(gè)問(wèn)題實(shí)在是太sui了,就因?yàn)椴恢朗裁磿r(shí)候把dataSource的配置寫(xiě)成<property name="defaultAutoCommit" value="false" />
          所以,所以,,媽的,改true就好了。。。

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

          mysql insert時(shí)報(bào)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..的意思時(shí)重復(fù)的鍵值,檢查主鍵或者其他唯一鍵值重復(fù)。

          posted @ 2012-03-20 20:08 yita 閱讀(332) | 評(píng)論 (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


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

          下載的時(shí)候順手搜了下,stackoverflow上有說(shuō)lion下安裝有問(wèn)題,原因是db2setup無(wú)法正確識(shí)別出系統(tǒng)構(gòu)架x86_64

          解決方法是先使用uname -m 查系統(tǒng)構(gòu)架。

          再修改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


          不過(guò)我下載下來(lái)的并沒(méi)有這個(gè)問(wèn)題,i*86默認(rèn)改為*86*了,不知道是我只安裝client還是ibm已經(jīng)修正這個(gè)bug了?
          但是安裝的時(shí)候亂碼,我就直接執(zhí)行db2install,很快就安裝結(jié)束,提示

          必須設(shè)置 DB2 實(shí)例環(huán)境

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

                DB2 實(shí)例用戶(hù)打開(kāi)新的登錄窗口。



          未完待許。。



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

          泛型方法

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

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

          mac快捷鍵以及增加桌面

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

          新增桌面 ,觸控板四指向下,或者按F3 打開(kāi)Mission Control 點(diǎn)右上角點(diǎn)擊+號(hào)。
          然后把不同程序按需要拖動(dòng)到不同桌面即可。

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

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

          mac下使用eclipse的svn報(bào)錯(cuò)問(wèn)題

           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插件之后報(bào)加載JavaHL libary錯(cuò)誤,看了一對(duì)說(shuō)是要加參數(shù)指定 java.library.path。加了之后發(fā)現(xiàn)沒(méi)用,又搜了搜找到這個(gè)

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

          其中mac os 里有段寫(xiě)到

          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/下載之,下載需要先注冊(cè),找到10.7版的。再開(kāi)開(kāi)eclipse,同步svn就沒(méi)有問(wèn)題

           

          ps.在sinaapp上看到介紹svnx這個(gè)客戶(hù)端,紀(jì)錄下,有時(shí)間試試

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

          Struts2 注解基礎(chǔ)

          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]

          先是報(bào)這個(gè)錯(cuò),因?yàn)閟truts2的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默認(rèn)result頁(yè)面存放在WEB-INF/content.(可以通過(guò)struts.convention.result.path屬性來(lái)設(shè)置)。

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

          2.convention plugin查找類(lèi)的規(guī)則

              convention plugin會(huì)查找struts、struts2、action、actions等包里的滿(mǎn)足以下條件的類(lèi)(好像可以設(shè)置)

          • 實(shí)現(xiàn)或繼承com.opensymphony.xwork2.Action、ActionSupport的類(lèi)。
          • 或者action結(jié)尾的類(lèi)名
            修改包查找規(guī)則修改下面兩個(gè)屬性
          <constant name="struts.convention.package.locators" value="test" />
          <constant name="struts.convention.package.locators.basePackage" value="com.test" />

          3.convention plugin類(lèi)對(duì)應(yīng)URL規(guī)則

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

          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對(duì)應(yīng)頁(yè)面名稱(chēng)

            頁(yè)面命名與類(lèi)名規(guī)則相同,再加上“-”與result值即可,如果找不到result的頁(yè)面,似乎會(huì)返回到省略result名稱(chēng)的頁(yè)面,還有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頁(yè)面,會(huì)自動(dòng)查找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) | 評(píng)論 (0)編輯 收藏

          vim的一些配置。

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

          1 source $VIMRUNTIME/mswin.vim
          2 behave mswin

           

          解決亂碼問(wèn)題

          " 設(shè)定默認(rèn)解碼
          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

           

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

          順便得加上這個(gè)函數(shù)

          fun! MySys()
          return "windows"
          endfun




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

          主站蜘蛛池模板: 承德县| 九江县| 莆田市| 监利县| 饶平县| 南陵县| 扶绥县| 铜川市| 灵山县| 八宿县| 武清区| 阿荣旗| 通州市| 石狮市| 合肥市| 通许县| 长汀县| 陈巴尔虎旗| 漳浦县| 光泽县| 巴林左旗| 西乌珠穆沁旗| 白山市| 富川| 阜新| 十堰市| 乌拉特后旗| 松桃| 虞城县| 克什克腾旗| 永昌县| 哈尔滨市| 蒙城县| 新津县| 阿坝| 德清县| 平顶山市| 手游| 海城市| 伊金霍洛旗| 龙门县|