注意writer的參數(shù)有多個(gè),特別是有一個(gè)boolean的參數(shù)決定刷新或在附加文本
輸出的結(jié)果示例:
2006.12.12?at?10:21:13
start?connection?databse:
driver?name:oracle.jdbc.driver.OracleDriver
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)的記錄.
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)表示。
org.hibernate.hql.QuerySplitter - no persistent classes found for query class:
意味著你沒(méi)有將someclass的配置文件放在hibernate.config或沒(méi)有寫(xiě)配置文件。
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,
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表示。
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è)面中,怎么處理。
為了將業(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();
???private static WFEngine instance;
??? public static final WFEngine getInstance() {
??????? return instance;
??? }
<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將取不到值。
昨天晚上我給他講了英文笑話,雖然他指出了很多錯(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.
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è)面的值亂碼
<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)用它的方法。
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)控制