隨筆 - 23  文章 - 3  trackbacks - 0
          <2006年4月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456

          常用鏈接

          留言簿(1)

          隨筆檔案

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          注意writer的參數(shù)有多個(gè),特別是有一個(gè)boolean的參數(shù)決定刷新或在附加文本

          ????????????log? = ?? new ?PrintWriter( new ?FileOutputStream(fl, true ), true );
          ????????????SimpleDateFormat?df?
          = ? new ?SimpleDateFormat( " yyyy.MM.dd?'at'?hh:mm:ss\n "
          );
          ????????????Date?now?
          = ? new
          ?Date();
          ????????????String?dateformat?
          =
          ?df.format(now)
          ????????????BufferedWriter?bf??
          = ? new ?BufferedWriter( new ?FileWriter(fl,? true
          ));
          ????????????bf.append(dateformat);
          ????????????bf.close();
          ????????????log.println(
          " start?connection?databse: "
          );
          ????????????log.println(
          " driver?name: " .concat(driveName);


          輸出的結(jié)果示例:
          2006.12.12?at?10:21:13
          start?connection?databse:
          driver?name:oracle.jdbc.driver.OracleDriver

          posted @ 2006-12-12 12:16 aimy 閱讀(222) | 評(píng)論 (0)編輯 收藏
          1、org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [com.xindeco.business.pojo.NonageRegister#82]
          ?at org.hibernate.ObjectNotFoundException.throwIfNull(ObjectNotFoundException.java:27)
          ?at org.hibernate.proxy.AbstractLazyInitializer.initialize(AbstractLazyInitializer.java:65)
          ?at org.hibernate.proxy.AbstractLazyInitializer.getImplementation(ApplicationFilterChain.java:252)
          ?at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
          ?at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:672)
          ?at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:463)
          ?at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:398)
          ?at org.apache.catalina.core.ApplicationDispatcher.forward

          錯(cuò)誤的原因:
          在nonregsiter中已經(jīng)手動(dòng)刪除了id=‘82’的記錄,而在WF_task以及wf-proces中還有bizclass = '3' && bizId = '82'的記錄,只要?jiǎng)h除wf-task中相應(yīng)的記錄.
          posted @ 2006-07-09 16:17 aimy 閱讀(233) | 評(píng)論 (0)編輯 收藏

          ProcessInstance.hbm.xml:

          <? xml?version = " 1.0 " ?encoding = " UTF-8 " ?>

          <! DOCTYPE?hibernate - mapping?PUBLIC
          ????
          " -//Hibernate/Hibernate?Mapping?DTD?3.0//EN " ?
          ????
          " http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd " >

          < hibernate - mapping
          >
          ????
          < class
          ????????name
          = " com.xindeco.workflow.ProcessInstance "
          ????????table
          = " WF_PROCESS "
          ????????dynamic
          - update = " true "
          ????????dynamic
          - insert = " true "
          ????????select
          - before - update = " false "
          ????????optimistic
          - lock = " version "
          ????
          >

          ????????
          < id
          ????????????name
          = " ID "
          ????????????column
          = " ID "
          ????????????type
          = " long "
          ????????????length
          = " 30 "
          ????????
          >
          ????????????
          < generator? class = " native " >
          ????????????
          </ generator >
          ????????
          </ id >

          ????????
          < discriminator
          ????????????column
          = " bizClass "
          ????????????type
          = " string "
          ????????
          />
          ????????
          ????????
          < property
          ????????????name
          = " state "
          ????????????type
          = " java.lang.Integer "
          ????????????update
          = " true "
          ????????????insert
          = " true "
          ????????????access
          = " property "
          ????????????column
          = " state "
          ????????????length
          = " 10 "
          ????????
          />
          ????????
          ????????
          < many - to - one
          ????????????name
          = " flow "
          ????????????
          class = " com.xindeco.workflow.WFFlow "
          ????????????cascade
          = " none "
          ????????????outer
          - join = " auto "
          ????????????update
          = " true "
          ????????????insert
          = " true "
          ????????????access
          = " property "
          ????????????column
          = " flowId "
          ????????
          />

          ????????
          < set
          ????????????name
          = " tasks "
          ????????????lazy
          = " true "
          ????????????inverse
          = " true "
          ????????????cascade
          = " delete "
          ????????????sort
          = " unsorted "
          ????????
          >

          ??????????????
          < key
          ??????????????????column
          = " processId "
          ??????????????
          >
          ??????????????
          </ key >

          ??????????????
          < one - to - many
          ??????????????????
          class = " com.xindeco.workflow.WFTask "
          ??????????????
          />

          ????????
          </ set >

          ????
          </ class >

          </ hibernate - mapping >

          CollRegPI.hbm.xml:

          <?xml?version="1.0"?>
          <!DOCTYPE?hibernate-mapping?PUBLIC
          ??????
          "-//Hibernate/Hibernate?Mapping?DTD?3.0//EN"
          ??????????
          "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

          <hibernate-mapping?default-access="field"?>

          ??
          <subclass?name="com.xindeco.business.pojo.wf.CollRegPI"
          ????????????discriminator
          -value="2"
          ????????????
          extends="com.xindeco.workflow.ProcessInstance"
          ????????????lazy
          ="false">

          ????????????
          <many-to-one?name="collReg"
          ?????????????????
          class="com.xindeco.business.pojo.CollReg"
          ?????????????????column
          ="bizId"
          ?????????????????cascade
          ="none"/>
          </subclass>
          </hibernate-mapping>

          數(shù)據(jù)庫(kù)的數(shù)據(jù):
          ???? id??? flowid????bizId???bizClass???state
          ??21????? ?2????????? ?9 ???????? 2???????? ???? 0
          ?22???????? 2???????? 10???????? 2???????????? ?0
          ?23???????? 2???????? 11???????? 2??????????????0
          ?24???????? 2???????? 12???????? 2????????????? 0
          ?25???????? 2???????? 13???????? 2????????????? 0
          ?26???????? 2???????? 14???????? 2????????????? 0
          ?29???????? 2???????? 17???????? 2???????????? ?0
          ?30???????? 2???????? 18???????? 2??????????? ? 1
          ?44????? ?? 4?????? ??1?????? ?? 32????? ?????? 0
          ?45????? ?? 4?????? ? 2?????? ??? 32????? ?????? 1
          ?46????? ?? 5??????????1??????????33?????????????0
          ?47?????? ? 5??????????2???????????33?????????????1
          ?48??????? ?5??????????3???????????33????? ?????? 0
          ?50????? ? ?3????????? 1????????????3??????????????0
          ?51????? ? ?3???????? 1????????????3??????????????0

          如果bizclass=2是同一種類(lèi)型的class。由????????
          ?????????<discriminator
          ????????????column
          ="bizClass"
          ????????????type
          ="string"
          ????????
          />來(lái)表示。
          posted @ 2006-07-06 10:37 aimy 閱讀(391) | 評(píng)論 (0)編輯 收藏
          org.hibernate.hql.QuerySplitter - no persistent classes found for query class:
          意味著你沒(méi)有將someclass的配置文件放在hibernate.config或沒(méi)有寫(xiě)配置文件。
          posted @ 2006-07-04 10:30 aimy 閱讀(1174) | 評(píng)論 (0)編輯 收藏
          1,通過(guò)構(gòu)造函數(shù)創(chuàng)建bean
          ?<bean?id="baseDAO"?class="com.aimy.core.dao.impl.BaseDAOImpl">
          相當(dāng)于
          basedaoimpl?baseDAO?
          =?new?BaseDAOImpl();
          2,通過(guò)靜態(tài)工廠創(chuàng)建bean
          <bean?id="driver1"?class="com.aimy.driver.driverManager"
          factory
          -method="createInstance"/>
          相當(dāng)于
          Object?driver1?
          =?driverManager.createInstance();

          其中沒(méi)有指定driverManager.createInstance();返回對(duì)象的類(lèi)型,而且createInstance()必須是static方法
          3,通過(guò)實(shí)例工廠方法創(chuàng)建bean
          <bean?id="father"?class="com.aimy.Father"/>
          ........
          <bean?id="son"?factory-bean="father"?factory-method="createSon"/>
          相當(dāng)于
          Father?father?
          =?new?Father();
          Object?son?
          =?father.createSon();

          其中father和son必須在同一個(gè)bean工廠或父bean工廠,即在同一個(gè)applicationcontext或子applicationcontext


          二、如果applicationcontext默認(rèn)預(yù)實(shí)例化那些singleton bean,這樣就可以在beanfactory裝載時(shí)就檢查出錯(cuò)誤,而如果singleton bean設(shè)置為lazy-mode,
          posted @ 2006-06-26 23:26 aimy 閱讀(237) | 評(píng)論 (0)編輯 收藏
          hibernate 保存空值的細(xì)節(jié)
          1。如果字段在pojo類(lèi)中是復(fù)雜對(duì)象類(lèi)型,則在數(shù)據(jù)庫(kù)用nulll表示。
          2。如果字段在pojo類(lèi)中是簡(jiǎn)單數(shù)據(jù)類(lèi)型,則在數(shù)據(jù)庫(kù)用0表示。
          posted @ 2006-06-26 09:56 aimy 閱讀(174) | 評(píng)論 (0)編輯 收藏
          1. document.name.value----->document.all.name.value
          2. eval(document.all.name)---->eval('document.all.name')
          3.javascript:window.history.go(-1)
          4、在action方法中只要拋出exception,就會(huì)跳到j(luò)spexception頁(yè)面中,怎么處理。
          posted @ 2006-06-22 13:19 aimy 閱讀(193) | 評(píng)論 (0)編輯 收藏
          為了將業(yè)務(wù)邏輯放到service層,比如判斷登陸用戶的信息,而在service層無(wú)法用SysUser user = (SysUser) request.getSession().getAttribute(WebConstants.SESSION_USER);因此在BaseService設(shè)一個(gè)屬性為
          ??????public void setOperator(Entity operator);
          ??????public Entity getOperator();
          posted @ 2006-05-17 11:17 aimy 閱讀(298) | 評(píng)論 (0)編輯 收藏
          ???private static WFEngine instance;
          ??? public static final WFEngine getInstance() {
          ??????? return instance;
          ??? }
          posted @ 2006-05-17 10:05 aimy 閱讀(200) | 評(píng)論 (0)編輯 收藏

          <sqlMap namespace="PersonnelRegist">

          ? <typeAlias alias="ID" type="com.xindeco.core.pojo.IDEntity"/>
          ? </select>
          ?? <select id="GraAppInfo.searchUpApply" parameterClass="com.xindeco.business.dto.GraAppInfoDTO"????resultClass="ID" cacheModel="userCache">
          ?? select distinct a.ID AS id
          ?? from TGraAppInfo a? left join TEMPLOYUNITBASEINFO b on a.unit=b.MEMBERID
          ?? where appstatus = '1'
          ?? <dynamic>
          ?? <isNotEmpty prepend="AND" property="name">(a.name like '%' + #name# + '%')</isNotEmpty>
          ?? <isNotEmpty prepend="AND" property="unit">(b.UNITNAME like '%' + #unit# + '%')</isNotEmpty>
          ?? </dynamic>
          ? </select>
          </sqlMap>

          注意sqlmapGraAppInfoDTO的name,unit只能是基本數(shù)據(jù)類(lèi)型,不能是復(fù)雜數(shù)據(jù)類(lèi)型.
          2、<script>的位置
          <script>
          form1.srchEdit.value='<%=srchEdit%>';
          form1.srchType.value='<%=srchType%>';????
          </script>
          <form>
          <input type="text" name="srchEdit"/>
          <input type="text" name="srchType"/></form>
          與<form>
          <input type="text" name="srchEdit"/>
          <input type="text" name="srchType"/>
          </form>
          <script>
          form1.srchEdit.value='<%=srchEdit%>';
          form1.srchType.value='<%=srchType%>';????
          </script>
          的差別,必須在form加載完對(duì)它賦值,否則srchEdit又重新加載,為null

          3、hibernate屬性設(shè)置出現(xiàn)錯(cuò)誤:
          ????? 如果pojo類(lèi)取fSUnit屬性名,系統(tǒng)將無(wú)法識(shí)別。get和set將取不到值。

          posted @ 2006-05-11 10:06 aimy 閱讀(314) | 評(píng)論 (0)編輯 收藏
          5-8
          昨天晚上我給他講了英文笑話,雖然他指出了很多錯(cuò)誤,但那是個(gè)好的開(kāi)始。
          ???? A redneck bought a tickect and won the lottery.
          ???? He went to claim it .He said:"I want $20 million right now"
          who verified his tickect number replied to him :"No,sir.It doesn't work this way.we give you $1 million today,you will get the rest spread on for the next 19 years."
          ???? The redneck said:"I want all my money.I won it,and i want it"
          ????? The man had to explained to him patiently:"you would get $1 million,and the rest during the next 19 years."
          ????? The redneck ,furious with the man ,screamed out:"I want all my money.If you don't give??me all my money ,i want my dollar back!"
          注意讀音:money、million、battle zone。

          我的叔叔silas?? H.E.Bates
          ????? 我的叔叔silas??活了九十五歲,有充足的時(shí)間去嘗試很多事情.他一度做過(guò)掘墓人.
          ????? In a life of 95 years ,my uncle found time to try most things, there was a time he become a gravedigger.
          posted @ 2006-05-09 14:34 aimy 閱讀(110) | 評(píng)論 (0)編輯 收藏

          1、get是從服務(wù)器上取得數(shù)據(jù),post是向服務(wù)器上傳送數(shù)據(jù)。
          2、get是將參數(shù)數(shù)據(jù)隊(duì)列(表單)加到提交表單的action所指定的url中,值和表單的各個(gè)字段是相互對(duì)應(yīng)的,Get將表單中數(shù)據(jù)的按照variable=value的形式,添加到action所指向的URL后面,并且兩者使用“?”連接,而各個(gè)變量之間使用“&”連接,在url中是可以看見(jiàn)的,
          post是將表單各個(gè)字段放在http header內(nèi)一起傳送到action中的URL中,
          3、get,服務(wù)器通過(guò)request.getQuery()獲得對(duì)應(yīng)的值;對(duì)于post,服務(wù)器通過(guò)request.getForm()表單的值。
          4、get,傳送的數(shù)據(jù)小,post,傳送的數(shù)據(jù)大,上傳文件一般用post
          特別注意:
          <form action="/GraAppInfo/GraAppInfo.do?method=UpList"? method="post">
          <select name="srchType">
          ???? <option value="0">名字</option>
          ???? <option value="1">用人單位</option>
          ???</select>
          ???<input height="18" name="srchEdit" type="text" align="right">
          ? <input? type="submit" value="查詢">

          顯示的URL:http://localhost:8080/GraAppInfo/GraAppInfo.do?method=UpList
          <form action="/GraAppInfo/GraAppInfo.do?method=UpList"? method="get">
          顯示的URL:http://localhost:8080/GraAppInfo/GraAppInfo.do?srchType=0&srchEdit=da
          可見(jiàn)post 會(huì)覆蓋action中的參數(shù),
          5、中文用post傳遞不會(huì)出現(xiàn)亂碼,用get傳遞會(huì)出現(xiàn)亂碼
          所以傳到action后要通過(guò)
          String srchEdit = new String(graForm.getSrchEdit().getBytes("iso8859-1"), "gb2312");
          處理。
          二、傳到頁(yè)面的值亂碼

          posted @ 2006-05-08 09:50 aimy 閱讀(218) | 評(píng)論 (0)編輯 收藏
          <props>
          ??????? <prop key="add*">PROPAGATION_REQUIRED</prop>
          ??????? <prop key="cancel*">PROPAGATION_REQUIRED</prop>
          ??????? <prop key="create*">PROPAGATION_REQUIRED</prop>
          ??????? <prop key="save*">PROPAGATION_REQUIRED</prop>
          </props>
          如果service層沒(méi)有用這些字母開(kāi)頭命名,spring自動(dòng)將它處理為默認(rèn)的訪問(wèn)模式--PROPAGATION_REQUIRED,readOnly
          如果在action直接調(diào)用dao層也不行,比如service.getbaseDAO.update(object)也會(huì)出現(xiàn)類(lèi)似的錯(cuò)誤,因?yàn)槭聞?wù)被攔截了,所以dao層的方法最好用protect,這樣只有同一個(gè)包里的類(lèi)可以調(diào)用它的方法。
          posted @ 2006-04-30 14:37 aimy 閱讀(85) | 評(píng)論 (0)編輯 收藏

          MENUID?UPMENUID?MENUNAME?MENUURL?MENUSEQ?LAYERLEVEL?RIGHTCODE?ISSHOW?TABLETYPE?STARTSTATE
          ?
          ?1083?1001?畢業(yè)生招聘?#?1?1?1083?1??
          ?1084?1083?畢業(yè)生申報(bào)?/GraAppInfo/GraAppInfo.do?method=graappinfolist?6?9?1084?1??

          menuid 該層菜單的id ?upmenuid 上一層菜單id? menuname 菜單名字
          menuurl 該層菜單的地址(首層菜單為#,沒(méi)有地址)
          menuseq 該層菜單在上一層菜單的順序
          layerlevel 如果是最后一層的菜單為9,其他為1
          rigntcode關(guān)聯(lián)到權(quán)限表=menuid
          idshow 是否顯示

          權(quán)限表:
          RIGHTID?RIGHTCODE?ROLETYPE?ROLEID?DEPTID?USERID?MENUID?FUNNAME
          1084??????????????? 1084????????????? 2????????????????????2??????????????????
          ?????????????????????0??????? 0??????????? 1084?????????? 畢業(yè)生申報(bào)
          rightid=menuid=rightcode,roletype,roleid

          這是單位的菜單設(shè)置和權(quán)限設(shè)置(1000〈menuid〈2000)

          2、人事單位內(nèi)部的設(shè)置(4000〈munuid〈5000)
          權(quán)限的設(shè)置通過(guò)頁(yè)面來(lái)控制

          posted @ 2006-04-30 11:19 aimy 閱讀(145) | 評(píng)論 (0)編輯 收藏
          主站蜘蛛池模板: 隆子县| 忻州市| 离岛区| 桃江县| 南丹县| 富阳市| 岢岚县| 马山县| 香港 | 青冈县| 资源县| 黑水县| 河曲县| 苏尼特右旗| 黔东| 杭锦旗| 潢川县| 和平县| 隆安县| 邻水| 华蓥市| 丰顺县| 泗水县| 保山市| 平武县| 金寨县| 承德市| 民和| 德州市| 灌南县| 乐东| 措美县| 龙江县| 九龙坡区| 瑞昌市| 富源县| 响水县| 石城县| 丘北县| 庄浪县| 通州市|