锘??xml version="1.0" encoding="utf-8" standalone="yes"?>伊人久久大香线蕉亚洲五月天 ,国产亚洲自拍一区,亚洲熟妇成人精品一区http://m.tkk7.com/patterns/category/8262.html紱葷鍘熶笂鑽夛紝涓宀佷竴鏋崳銆傞噹鐏儳涓嶅敖錛屾槬椋庡惞鍙堢敓銆? zh-cnTue, 27 Feb 2007 10:29:09 GMTTue, 27 Feb 2007 10:29:09 GMT60鎸佺畫灞傚璞$殑hashCode鍜宔quals鏂規(guī)硶http://m.tkk7.com/patterns/archive/2007/01/13/po_hashCode_equals.html閲庤崏閲庤崏Sat, 13 Jan 2007 11:13:00 GMThttp://m.tkk7.com/patterns/archive/2007/01/13/po_hashCode_equals.htmlhttp://m.tkk7.com/patterns/comments/93630.htmlhttp://m.tkk7.com/patterns/archive/2007/01/13/po_hashCode_equals.html#Feedback0http://m.tkk7.com/patterns/comments/commentRss/93630.htmlhttp://m.tkk7.com/patterns/services/trackbacks/93630.html

浣跨敤 hibernate 蹇竴騫翠簡(jiǎn)錛屼竴鐩翠嬌鐢ㄥ緱姣旇緝鑲ゆ祬錛岀敋鑷蟲病鏈夋寮忎嬌鐢ㄨ繃瀵硅薄鍏崇郴銆傝繎孌墊椂闂存兂娣卞叆鐮旂┒涓涓嬶紝浠ヤ究鍦ㄩ」鐩腑鎺ㄥ箍錛屽噺灝戜笉蹇呰鐨勫璞$淮鎶ゅ拰緙栫▼銆傞棶棰樹笉鏈熻岄亣錛屽湪澶氬澶氬叧緋諱腑錛屽嚭鐜頒簡(jiǎn)閫掕鍔犺澆鐨勭幇璞★紝渚嬪錛氱敤鎴峰拰瑙掕壊鐨勫叧緋伙紝涓涓敤鎴峰彲鑳芥湁澶氫釜瑙掕壊錛屼竴涓鑹蹭腑鍖呭惈澶氫釜鐢ㄦ埛銆傛垜鏄氳繃甯︽湁榪炴帴琛ㄧ殑澶氬澶氬叧緋誨疄鐜扮殑錛岀敤鎴峰拰瑙掕壊瀵硅薄涓兘緇存寔浜?jiǎn)涓涓?/span> Set 瀵硅薄錛岀敤浠ュ歡榪熷姞杞藉叧緋匯備絾鏄紝鍦ㄦ垜寤惰繜鍔犺澆鐢ㄦ埛鎷ユ湁鐨勮鑹叉椂錛岃鍔犺澆鐨勮鑹插張鍔犺澆瀹冩墍鍖呭惈鐨勭敤鎴鳳紝琚姞杞界殑鐢ㄦ埛鍙堝姞杞芥墍鎷ユ湁鐨勮鑹詫紝榪欐牱閫掕鍔犺澆涓嬪幓錛岀敱浜?/span> session 鐨勫叧闂細(xì)鎶涘嚭寮傚父瀵艱嚧紼嬪簭涓銆傚紑濮嬬櫨鎬濅笉寰楀叾瑙o紝鍦ㄤ粩緇嗘煡鐪嬫姏鍑虹殑寮傚父鍫嗘爤鏃訛紝緇堜簬鍙戠幇浜?jiǎn)闂鎵鍦ㄣ備範(fàn)鎯紒閿欒鐨勪範(fàn)鎯傛垜浠墍浣跨敤鐨勬寔緇眰瀵硅薄浼?xì)鐟翩壙涓涓熀紜綾伙紝璇ョ被鈥滃疄鐜扳濅簡(jiǎn) hashCode 鍜?/span> equals 鏂規(guī)硶錛屼唬鐮佸涓嬶細(xì)

public boolean equals(Object o) {

聽聽聽 return EqualsBuilder.reflectionEquals(this, o);

}

public int hashCode() {

return HashCodeBuilder.reflectionHashCode(this);

}

hibernate 灝嗙敤鎴鋒墍鎷ユ湁鐨勮鑹插璞℃斁榪?/span> Set 涓紝瀹為檯 Set 浼?xì)璋冪?/span> hashCode 鍜?/span> equals 鏉ュ垽鏂袱涓璞℃槸鍚︾浉絳夛紝榪欐牱闂灝辨潵浜?jiǎn)锛?/span> HashCodeBuilder.reflectionHashCode(this) 鏂規(guī)硶浣跨敤鍙嶅皠璋冪敤瑙掕壊瀵硅薄鐨?/span> getUsers() 鏂規(guī)硶錛?/span> hibernate 鍙堝姞杞借鑹叉墍鍖呭惈鐨勭敤鎴鳳紝鑳芥病鏈夐棶棰樺悧錛熺戶鑰屾垜浠緱鍙嶆濅竴涓嬫寔緇眰瀵硅薄鏈夋病鏈夐氱敤鐨?/span> hashCode 鍜?/span> equals 鏂規(guī)硶銆?/span>

聽聽聽聽聽聽 鍙傝冦婃繁鍏ユ祬鍑?/span> Hibernate 銆嬪 hashCode 鍜?/span> equals 鏂規(guī)硶鐨勫鐞嗘湁涓ゅぇ縐嶏細(xì)

1銆?span style="FONT: 7pt 'Times New Roman'">聽 涓嶈鐩?/span>

闂錛氬疄浣撳璞$殑璺?/span> session 璇嗗埆闂錛屾牴鏈湪浜?/span> hashCode 榛樿璋冪敤 System.identityHashCode() 鏂規(guī)硶銆?/span>

2銆?span style="FONT: 7pt 'Times New Roman'">聽 瑕嗙洊

聽聽聽聽聽聽聽聽 浣跨敤瀵硅薄 pk

闂錛氭柊澧炲璞℃椂錛屾病鏈?/span> pk 錛岄偅涔堟墍鏈夌殑瀵硅薄閮界浉絳変簡(jiǎn)錛屼篃灝辨槸鍙兘鍔犲叆鐨勪竴鏉°?/span>

聽聽聽聽聽聽聽聽 鍊兼瘮瀵癸紙瀵瑰疄浣撳璞$殑鎵鏈夊睘鎬у艱繘琛屾瘮瀵癸紝鍙互浣跨敤 Commonclipse 鑷姩鐢熸垚錛?/span>

闂錛氳繃浜庝弗鏍箋?/font>

聽聽聽聽聽聽聽聽 涓氬姟鍏抽敭淇℃伅鍒ゅ畾

鏄兼瘮瀵圭殑涓涓瓙闆嗭紝鍙仛涓氬姟鍏抽敭灞炴х殑姣斿銆?/font>

涓漢瑙夊緱涓氬姟鍏抽敭淇℃伅鍒ゅ畾鐨勬柟娉曟瘮杈冨悎鐞嗭紝浣跨敤 Commonclipse 鑷姩鐢熸垚鍊兼瘮瀵癸紝娉ㄦ剰涓ょ偣錛?/span>

1銆?span style="FONT: 7pt 'Times New Roman'">聽 鍘繪帀瀹炰綋鍏寵仈闆嗗悎灞炴х殑姣斿錛屼笉鐒跺張浼?xì)鍑虹幇鎴戜笂杩扮殑鈥滈掕鍔犺澆鈥濈幇璞°?/span>

2銆?span style="FONT: 7pt 'Times New Roman'">聽 鑷姩鐢熸垚鐨?/span> hashCode 鏂規(guī)硶鍘繪帀 appendSuper(super.hashCode()) 錛岃嚜鍔ㄧ敓鎴愮殑 equals 鏂規(guī)硶鍘繪帀 appendSuper(super.equals(object)) 錛屼笉鐒朵綘鐨勫璞℃瘮杈冨拰鍔犲叆 collection 閮芥湁闂鐨勶紝銆婃繁鍏ユ祬鍑?/span> Hibernate 銆嬩功涓病鏈夊己璋冦?/span>



閲庤崏 2007-01-13 19:13 鍙戣〃璇勮
]]>
濡備綍鎶奌ibernate2.1鍗囩駭鍒癏ibernate3.0 http://m.tkk7.com/patterns/archive/2006/12/30/hibernate2_1_to_hibernate3.html閲庤崏閲庤崏Sat, 30 Dec 2006 01:37:00 GMThttp://m.tkk7.com/patterns/archive/2006/12/30/hibernate2_1_to_hibernate3.htmlhttp://m.tkk7.com/patterns/comments/90941.htmlhttp://m.tkk7.com/patterns/archive/2006/12/30/hibernate2_1_to_hibernate3.html#Feedback0http://m.tkk7.com/patterns/comments/commentRss/90941.htmlhttp://m.tkk7.com/patterns/services/trackbacks/90941.html 1.1 Hibernate API 鍙樺寲
1.1.1 鍖呭悕
1.1.2 org.hibernate.classic鍖?
1.1.3 Hibernate鎵渚濊禆鐨勭涓夋柟杞歡鍖?
1.1.4 寮傚父妯″瀷
1.1.5 Session鎺ュ彛
1.1.6 createSQLQuery()
1.1.7 Lifecycle 鍜?Validatable 鎺ュ彛
1.1.8 Interceptor鎺ュ彛
1.1.9 UserType鍜孋ompositeUserType鎺ュ彛
1.1.10 FetchMode綾?
1.1.11 PersistentEnum綾?
1.1.12 瀵笲lob 鍜孋lob鐨勬敮鎸?
1.1.13 Hibernate涓緵鎵╁睍鐨凙PI鐨勫彉鍖?
1.2 鍏冩暟鎹殑鍙樺寲
1.2.1 媯(gè)绱㈢瓥鐣?
1.2.2 瀵硅薄鏍囪瘑絎︾殑鏄犲皠
1.2.3 闆嗗悎鏄犲皠
1.2.4 DTD
1.3 鏌ヨ璇彞鐨勫彉鍖?
1.3.1 indices()鍜宔lements()鍑芥暟

灝界Hibernate 3.0 涓嶩ibernate2.1鐨勬簮浠g爜鏄笉鍏煎鐨勶紝浣嗘槸褰揌ibernate寮鍙戝皬緇勫湪璁捐Hibernate3.0鏃訛紝涓虹畝鍖栧崌綰ibernate鐗堟湰浣滀簡(jiǎn)鍛ㄥ埌鐨勮冭檻銆傚浜庣幇鏈夌殑鍩轟簬Hibernate2.1鐨凧ava欏圭洰錛屽彲浠ュ緢鏂逛究鐨勬妸瀹冨崌綰у埌Hibernate3.0銆?/font>

鏈枃鎻忚堪浜?jiǎn)Hibernate3.0鐗堟湰鐨勬柊鍙樺寲錛孒ibernate3.0鐗堟湰鐨勫彉鍖栧寘鎷笁涓柟闈細(xì)
錛?錛堿PI鐨勫彉鍖栵紝瀹冨皢褰卞搷鍒癑ava紼嬪簭浠g爜銆?br />錛?錛夊厓鏁版嵁錛屽畠?yōu)畣濯?jiǎng)鍝嶅埌瀵硅薄-鍏崇郴鏄犲皠鏂囦歡銆?br />錛?錛塇QL鏌ヨ璇彞銆?/font>

鍊煎緱娉ㄦ剰鐨勬槸錛?Hibernate3.0騫朵笉浼?xì)瀹屽叏鍙栦唬Hibernate2.1銆傚湪鍚屼竴涓簲鐢ㄧ▼搴忎腑錛屽厑璁窰ibernate3.0鍜孒ibernate2.1騫跺瓨銆?/font>

1.1 Hibernate API 鍙樺寲

1.1.1 鍖呭悕

Hibernate3.0鐨勫寘鐨勬牴璺緞涓? 鈥渙rg.hibernate鈥?錛岃屽湪Hibernate2.1涓負(fù)鈥渘et.sf.hibernate鈥濄傝繖涓鍛藉悕鍙樺寲浣垮緱Hibernate2.1鍜孒ibernate3.0鑳藉鍚屾椂鍦ㄥ悓涓涓簲鐢ㄧ▼搴忎腑榪愯銆?/font>

濡傛灉甯屾湜鎶婂凡鏈夌殑搴旂敤鍗囩駭鍒癏ibernate3.0錛岄偅涔堝崌綰х殑絎竴姝ユ槸鎶奐ava婧愮▼搴忎腑鐨勬墍鏈夆渘et.sf.hibernate鈥濇浛鎹負(fù)鈥渙rg.hibernate鈥濄?/font>

Hibernate2.1涓殑鈥渘et.sf.hibernate.expression鈥濆寘琚敼鍚嶄負(fù)鈥渙rg.hibernate.criterion鈥濄傚亣濡傚簲鐢ㄧ▼搴忎嬌鐢ㄤ簡(jiǎn)Criteria API錛岄偅涔堝湪鍗囩駭鐨勮繃紼嬩腑錛屽繀欏繪妸Java婧愮▼搴忎腑鐨勬墍鏈夆渘et.sf.hibernate.expression鈥濇浛鎹負(fù)鈥渙rg.hibernate.criterion鈥濄?/font>

濡傛灉搴旂敤浣跨敤浜?jiǎn)闄ibernate浠ュ鐨勫叾浠栧閮ㄨ蔣浠訛紝鑰岃繖涓閮ㄨ蔣浠跺張寮曠敤浜?jiǎn)Hibernate鐨勬帴鍙o紝閭d箞鍦ㄥ崌綰ф椂蹇呴』鍗佸垎灝忓績(jī)銆備緥濡侲HCache鎷ユ湁鑷繁鐨凜acheProvider錛?net.sf.ehcache.hibernate.Provider錛屽湪榪欎釜綾諱腑寮曠敤浜?jiǎn)Hibernate2.1涓殑鎺ュ彛錛屽湪鍗囩駭搴旂敤鏃訛紝鍙互閲囩敤浠ヤ笅鍔炴硶涔嬩竴鏉ュ崌綰HCache:

錛?錛夋墜宸ヤ慨鏀筺et.sf.ehcache.hibernate.Provider綾伙紝浣垮畠寮曠敤Hibernate3.0涓殑鎺ュ彛銆?br />錛?錛夌瓑鍒癊HCache杞歡鏈韓鍗囩駭涓轟嬌鐢℉ibernate3.0鍚庯紝浣跨敤鏂扮殑EHCache杞歡銆?br />錛?錛変嬌鐢℉ibernate3.0涓唴緗殑CacheProvider錛歰rg.hibernate.cache.EhCacheProvider銆?/font>

1.1.2 org.hibernate.classic鍖?/font>

Hibernate3.0鎶婁竴浜涜搴熷純鐨勬帴鍙i兘杞Щ鍒皁rg.hibernate.classic涓?/font>

1.1.3 Hibernate鎵渚濊禆鐨勭涓夋柟杞歡鍖?/font>

鍦℉ibernate3.0鐨勮蔣浠跺寘鐨刲ib鐩綍涓嬬殑README.txt鏂囦歡涓紝鎻忚堪浜?jiǎn)Hibernate3.0鎵渚濊禆鐨勭涓夋柟杞歡鍖呯殑鍙樺寲銆?/font>

1.1.4 寮傚父妯″瀷

鍦℉ibernate3.0涓紝HibernateException寮傚父浠ュ強(qiáng)瀹冪殑鎵鏈夊瓙綾婚兘緇ф壙浜?jiǎn)java.lang.RuntimeException銆傚洜姝ゅ湪緙栬瘧鏃訛紝緙栬瘧鍣ㄤ笉浼?xì)鍐崑個(gè)鏌ibernateException銆?/font>

1.1.5 Session鎺ュ彛

鍦℉ibernate3.0涓紝鍘熸潵Hibernate2.1鐨凷ession鎺ュ彛涓殑鏈変簺鍩烘湰鏂規(guī)硶涔熻搴熷純錛屼絾涓轟簡(jiǎn)綆鍖栧崌綰э紝榪欎簺鏂規(guī)硶渚濈劧鏄彲鐢ㄧ殑錛屽彲浠ラ氳繃org.hibernate.classic.Session瀛愭帴鍙f潵璁塊棶瀹冧滑錛屼緥濡傦細(xì)


org.hibernate.classic.Session session=sessionFactory.openSession();
session.delete("delete from Customer ");


鍦℉ibernate3.0涓紝org.hibernate.classic.Session鎺ュ彛緇ф壙浜?jiǎn)org.hibernate.Session鎺ュ彛錛屽湪org.hibernate.classic.Session鎺ュ彛涓寘鍚簡(jiǎn)涓緋誨垪琚簾寮冪殑鏂規(guī)硶錛屽find()銆乮nterate()絳夈係essionFactory鎺ュ彛鐨刼penSession()鏂規(guī)硶榪斿洖org.hibernate.classic.Session綾誨瀷鐨勫疄渚嬨傚鏋滃笇鏈涘湪紼嬪簭涓畬鍏ㄤ嬌鐢℉ibernate3.0錛屽彲浠ラ噰鐢ㄤ互涓嬫柟寮忓垱寤篠ession瀹炰緥錛?/font>

org.hibernate.Session session=sessionFactory.openSession();

濡傛灉鏄宸叉湁鐨勭▼搴忚繘琛岀畝鍗曠殑鍗囩駭錛屽茍涓斿笇鏈涗粛鐒惰皟鐢℉ibernate2.1涓璖ession鐨勪竴浜涙帴鍙o紝鍙互閲囩敤浠ヤ笅鏂瑰紡鍒涘緩Session瀹炰緥錛?/font>

org.hibernate.classic.Session session=sessionFactory.openSession();

鍦℉ibernate3.0涓紝Session鎺ュ彛涓搴熷純鐨勬柟娉曞寘鎷細(xì)
* 鎵ц鏌ヨ鐨勬柟娉曪細(xì)find()銆乮terate()銆乫ilter()鍜宒elete(String hqlSelectQuery)
* saveOrUpdateCopy()

Hibernate3.0涓寰嬮噰鐢╟reateQuery()鏂規(guī)硶鏉ユ墽琛屾墍鏈夌殑鏌ヨ璇彞錛岄噰鐢―ELETE 鏌ヨ璇彞鏉ユ墽琛屾壒閲忓垹闄わ紝閲囩敤merge()鏂規(guī)硶鏉ユ浛浠?saveOrUpdateCopy()鏂規(guī)硶銆?


鎻愮ず錛氬湪Hibernate2.1涓紝Session鐨刣elete()鏂規(guī)硶鏈夊嚑縐嶉噸杞藉艦寮忥紝鍏朵腑鍙傛暟涓篐QL鏌ヨ璇彞鐨刣elete()鏂規(guī)硶鍦℉ibernate3.0涓搴熷純錛岃屽弬鏁頒負(fù)Ojbect綾誨瀷鐨勭殑delete()鏂規(guī)硶渚濈劧琚敮鎸併俤elete(Object o)鏂規(guī)硶鐢ㄤ簬鍒犻櫎鍙傛暟鎸囧畾鐨勫璞★紝璇ユ柟娉曟敮鎸佺駭鑱斿垹闄ゃ?

Hibernate2.1娌℃湁瀵規(guī)壒閲忔洿鏂板拰鎵歸噺鍒犻櫎鎻愪緵寰堝ソ鐨勬敮鎸侊紝鍙傝<<綺鵑欻ibernate>>涓涔︾殑絎?3绔犵殑13.1.1鑺傦紙鎵歸噺鏇存柊鍜屾壒閲忓垹闄わ級(jí)錛岃孒ibernate3.0瀵規(guī)壒閲忔洿鏂板拰鎵歸噺鍒犻櫎鎻愪緵浜?jiǎn)鏀寔锛岃兘澶熺洿鎺ユ墽琛屾墯w噺鏇存柊鎴栨壒閲忓垹闄よ鍙ワ紝鏃犻渶鎶婅鏇存柊鎴栧垹闄ょ殑瀵硅薄鍏堝姞杞藉埌鍐呭瓨涓備互涓嬫槸閫氳繃Hibernate3.0鎵ц鎵歸噺鏇存柊鐨勭▼搴忎唬鐮侊細(xì)

Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();

String hqlUpdate = "update Customer set name = :newName where name = :oldName";
int updatedEntities = s.createQuery( hqlUpdate )
.setString( "newName", newName )
.setString( "oldName", oldName )
.executeUpdate();
tx.commit();
session.close();

浠ヤ笅鏄氳繃Hibernate3.0鎵ц鎵歸噺鍒犻櫎鐨勭▼搴忎唬鐮侊細(xì)

Session session = sessionFactory.openSession();
Transaction tx = session.beginTransaction();

String hqlDelete = "delete Customer where name = :oldName";
int deletedEntities = s.createQuery( hqlDelete )
.setString( "oldName", oldName )
.executeUpdate();
tx.commit();
session.close();

1.1.6 createSQLQuery()

鍦℉ibernate3.0涓紝Session鎺ュ彛鐨刢reateSQLQuery()鏂規(guī)硶琚簾寮冿紝琚Щ鍒皁rg.hibernate.classic.Session鎺ュ彛涓侶ibernate3.0閲囩敤鏂扮殑SQLQuery鎺ュ彛鏉ュ畬鎴愮浉鍚岀殑鍔熻兘銆?/font>

1.1.7 Lifecycle 鍜?Validatable 鎺ュ彛

Lifecycle鍜孷alidatable 鎺ュ彛琚簾寮冿紝騫朵笖琚Щ鍒皁rg.hibernate.classic鍖呬腑銆?/font>

1.1.8 Interceptor鎺ュ彛

鍦↖nterceptor 鎺ュ彛涓姞鍏ヤ簡(jiǎn)涓や釜鏂扮殑鏂規(guī)硶銆?鐢ㄦ埛鍒涘緩鐨処nterceptor瀹炵幇綾誨湪鍗囩駭鐨勮繃紼嬩腑錛岄渶瑕佷負(fù)榪欎袱涓柊鏂規(guī)硶鎻愪緵鏂規(guī)硶浣撲負(fù)絀虹殑瀹炵幇銆傛澶栵紝instantiate()鏂規(guī)硶鐨勫弬鏁頒綔浜?jiǎn)淇敼锛宨sUnsaved()鏂規(guī)硶琚敼鍚嶄負(fù)isTransient()銆?/font>

1.1.9 UserType鍜孋ompositeUserType鎺ュ彛

鍦║serType鍜孋ompositeUserType鎺ュ彛涓兘鍔犲叆浜?jiǎn)涓浜涙柊鐨勬柟娉曪紝榪欎袱涓帴鍙h縐誨埌org.hibernate.usertype鍖呬腑錛岀敤鎴峰畾涔夌殑UserType鍜孋ompositeUserType瀹炵幇綾誨繀欏誨疄鐜拌繖浜涙柊鏂規(guī)硶銆?

Hibernate3.0鎻愪緵浜?jiǎn)ParameterizedType鎺ュ彛錛岀敤浜庢洿濂界殑閲嶇敤鐢ㄦ埛鑷畾涔夌殑綾誨瀷銆?

1.1.10 FetchMode綾?/font>

FetchMode.LAZY 鍜?FetchMode.EAGER琚簾寮冦傚彇鑰屼唬涔嬬殑鍒嗗埆涓篎etchMode.SELECT 鍜孎etchMode.JOIN銆?/font>

1.1.11 PersistentEnum綾?/font>

PersistentEnum琚簾寮冨茍鍒犻櫎銆傚凡緇忓瓨鍦ㄧ殑搴旂敤搴旇閲囩敤UserType鏉ュ鐞嗘灇涓劇被鍨嬨?/font>

1.1.12 瀵笲lob 鍜孋lob鐨勬敮鎸?/font>

Hibernate瀵笲lob鍜孋lob瀹炰緥榪涜浜?jiǎn)鍖呰锛屼娇寰楅偅浜涙嫢鏈塀lob鎴朇lob綾誨瀷鐨勫睘鎬х殑綾葷殑瀹炰緥鍙互琚父紱匯佸簭鍒楀寲鎴栧弽搴忓垪鍖栵紝浠ュ強(qiáng)浼犻掑埌merge()鏂規(guī)硶涓?/font>

1.1.13 Hibernate涓緵鎵╁睍鐨凙PI鐨勫彉鍖?/font>

org.hibernate.criterion銆?org.hibernate.mapping銆?org.hibernate.persister鍜宱rg.hibernate.collection 鍖呯殑緇撴瀯鍜屽疄鐜板彂鐢熶簡(jiǎn)閲嶅ぇ鐨勫彉鍖栥傚鏁板熀浜嶩ibernate
2.1 鐨勫簲鐢ㄤ笉渚濊禆浜庤繖浜涘寘錛屽洜姝や笉浼?xì)琚奖鍝嶃傚鏋滀綘鐨勫簲鐢ㄦ墿灞曚簡(jiǎn)榪欎簺鍖呬腑鐨勭被錛岄偅涔堝繀欏婚潪甯稿皬蹇?jī)鐨勫鍙楀奖鍝嶇殑绋嬪簭浠g爜杩涜鍗嚲Uс?/font>

1.2 鍏冩暟鎹殑鍙樺寲

1.2.1 媯(gè)绱㈢瓥鐣?/font>

鍦℉ibernate2.1涓紝lazy灞炴х殑榛樿鍊間負(fù)鈥渇alse鈥濓紝鑰屽湪Hibernate3.0涓紝lazy灞炴х殑榛樿鍊間負(fù)鈥渢rue鈥濄傚湪鍗囩駭鏄犲皠鏂囦歡鏃訛紝濡傛灉鍘熸潵鐨勬槧灝勬枃浠朵腑鐨勬湁鍏沖厓绱狅紝濡?lt;set>銆?lt;class>絳夋病鏈夋樉寮忚緗甽azy灞炴э紝閭d箞蹇呴』鎶婂畠浠兘鏄懼紡鐨勮緗負(fù)lazy=鈥渢rue鈥濄傚鏋滆寰楄繖縐嶅崌綰ф柟寮忓緢楹葷儲(chǔ)錛屽彲浠ラ噰鍙栧彟涓綆鍗曠殑鍗囩駭鏂瑰紡錛氬湪<hibernate-mapping>鍏冪礌涓緗? default-lazy=鈥渇alse鈥濄?

1.2.2 瀵硅薄鏍囪瘑絎︾殑鏄犲皠

unsaved-value灞炴ф槸鍙夌殑錛屽湪澶氭暟鎯呭喌涓嬶紝Hibernate3.0灝嗘妸unsaved-value="0" 浣滀負(fù)榛樿鍊箋?/font>

鍦℉ibernate3.0涓紝褰撲嬌鐢ㄨ嚜鐒朵富閿拰娓哥瀵硅薄鏃訛紝涓嶅啀寮鴻揩瀹炵幇Interceptor.isUnsaved()鏂規(guī)硶銆?濡傛灉娌℃湁璁劇疆榪欎釜鏂規(guī)硶錛屽綋Hibernate3.0鏃犳硶鍖哄垎瀵硅薄鐨勭姸鎬佹椂錛屼細(xì)鏌ヨ鏁版嵁搴擄紝鏉ュ垽鏂繖涓璞″埌搴曟槸涓存椂瀵硅薄錛岃繕鏄父紱誨璞°備笉榪囷紝鏄懼紡鐨勪嬌鐢↖nterceptor.isUnsaved()鏂規(guī)硶浼?xì)鑾峰緱鏇村ソ鐨勬ц兘錛屽洜涓鴻繖鍙互鍑忓皯Hibernate鐩存帴璁塊棶鏁版嵁搴撶殑嬈℃暟銆?/font>

1.2.3 闆嗗悎鏄犲皠

<index>鍏冪礌鍦ㄦ煇浜涙儏鍐典笅琚?lt;list-index>鍜?lt;map-key>鍏冪礌鏇夸唬銆傛澶栵紝Hibernate3.0鐢?lt;map-key-many-to-many> 鍏冪礌鏉ユ浛浠e師鏉ョ殑<key-many-to-many>.鍏冪礌錛岀敤<composite-map-key>鍏冪礌鏉ユ浛浠e師鏉ョ殑<composite-index>鍏冪礌銆?/font>

1.2.4 DTD

瀵硅薄-鍏崇郴鏄犲皠鏂囦歡涓殑DTD鏂囨。錛岀敱鍘熸潵鐨勶細(xì)
http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd
鏀逛負(fù)錛?br />
http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd

1.3 鏌ヨ璇彞鐨勫彉鍖?/font>

Hibernate3.0 閲囩敤鏂扮殑鍩轟簬ANTLR鐨凥QL/SQL鏌ヨ緲昏瘧鍣紝涓嶈繃錛孒ibernate2.1鐨勬煡璇㈢炕璇戝櫒涔熶緷鐒跺瓨鍦ㄣ傚湪Hibernate鐨勯厤緗枃浠朵腑錛宧ibernate.query.factory_class灞炴х敤鏉ラ夋嫨鏌ヨ緲昏瘧鍣ㄣ備緥濡傦細(xì)
錛?錛夐夋嫨Hibernate3.0鐨勬煡璇㈢炕璇戝櫒錛?br />hibernate.query.factory_class= org.hibernate.hql.ast.ASTQueryTranslatorFactory
錛?錛夐夋嫨Hibernate2.1鐨勬煡璇㈢炕璇戝櫒
hibernate.query.factory_class= org.hibernate.hql.classic.ClassicQueryTranslatorFactory


鎻愮ず錛欰NTLR鏄敤綰疛ava璇█緙栧啓鍑烘潵鐨勪竴涓紪璇戝伐鍏鳳紝瀹冨彲鐢熸垚Java璇█鎴栬呮槸C++鐨勮瘝娉曞拰璇硶鍒嗘瀽鍣紝騫跺彲浜х敓璇硶鍒嗘瀽鏍?wèi)迤堝璇ユ爲(wèi)杩涜閬嶅巻銆侫NTLR鐢變簬鏄函Java鐨勶紝鍥犳鍙互瀹夎鍦ㄤ換鎰忓鉤鍙頒笂錛屼絾鏄渶瑕丣DK鐨勬敮鎸併?

Hibernate寮鍙戝皬緇勫敖鍔涗繚璇丠ibernate3.0鐨勬煡璇㈢炕璇戝櫒鑳藉鏀寔Hibernate2.1鐨勬墍鏈夋煡璇㈣鍙ャ備笉榪囷紝瀵逛簬璁稿宸茬粡瀛樺湪鐨勫簲鐢紝鍦ㄥ崌綰ц繃紼嬩腑錛屼篃涓嶅Θ浠嶇劧浣跨敤Hibernate2.1鐨勬煡璇㈢炕璇戝櫒銆?br />鍊煎緱娉ㄦ剰鐨勬槸錛?Hibernate3.0鐨勬煡璇㈢炕璇戝櫒瀛樺湪涓涓狟ug錛氫笉鏀寔鏌愪簺theta-style榪炵粨鏌ヨ鏂硅█錛氬Oracle8i鐨凮racleDialect鏂硅█銆丼ybase11Dialect銆傝В鍐寵繖涓闂鐨勫姙娉曟湁涓ょ錛氾紙1錛夋敼涓轟嬌鐢ㄦ敮鎸丄NSI-style榪炵粨鏌ヨ鐨勬柟璦錛屽 Oracle9Dialect,錛?錛夊鏋滃崌綰х殑鏃跺欓亣鍒拌繖涓闂錛岄偅涔堣繕鏄敼涓轟嬌鐢℉ibernate2.1鐨勬煡璇㈢炕璇戝櫒銆?/font>

1.3.1 indices()鍜宔lements()鍑芥暟

鍦℉QL鐨剆elect瀛愬彞涓簾寮冧簡(jiǎn)indices()鍜宔lements()鍑芥暟錛屽洜涓鴻繖涓や釜鍑芥暟鐨勮娉曞緢璁╃敤鎴瘋垂瑙o紝鍙互鐢ㄦ樉寮忕殑榪炴帴鏌ヨ璇彞鏉ユ浛浠?select elements(...) 銆傝屽湪HQL鐨剋here瀛愬彞涓紝浠嶇劧鍙互浣跨敤elements()鍑芥暟銆?/font>



閲庤崏 2006-12-30 09:37 鍙戣〃璇勮
]]>
velocity妯℃澘璺緞鍙堜竴瑙?/title><link>http://m.tkk7.com/patterns/archive/2006/11/28/velocity_template_path_another_method.html</link><dc:creator>閲庤崏</dc:creator><author>閲庤崏</author><pubDate>Tue, 28 Nov 2006 06:21:00 GMT</pubDate><guid>http://m.tkk7.com/patterns/archive/2006/11/28/velocity_template_path_another_method.html</guid><wfw:comment>http://m.tkk7.com/patterns/comments/84041.html</wfw:comment><comments>http://m.tkk7.com/patterns/archive/2006/11/28/velocity_template_path_another_method.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/patterns/comments/commentRss/84041.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/patterns/services/trackbacks/84041.html</trackback:ping><description><![CDATA[ <font size="2">鐮旂┒hibernatesynchronizer鐨勬簮鐮侊紝鐪嬪埌浠栧皢velocity妯℃澘鍜岀紪璇戠殑綾諱竴璧鋒墦鍖呭湪jar鍖呬腑錛屽湪鑾峰緱妯℃澘鏃朵嬌鐢?br />Xobject.class.getClassLoader().getResourceAsStream("/templates/xx.vm")鑾峰緱嫻侊紝鐒跺悗鍐嶅皢杞彉鎴愬瓧絎︿覆<br />public static String getStringFromStream(InputStream is) throws IOException {<br />聽聽聽聽聽聽聽 if (null == is)<br />聽聽聽聽聽聽聽聽聽聽聽 return null;<br />聽聽聽聽聽聽聽 try {<br />聽聽聽聽聽聽聽聽聽聽聽 InputStreamReader reader = new InputStreamReader(is);<br />聽聽聽聽聽聽聽聽聽聽聽 char[] buffer = new char[1024];<br />聽聽聽聽聽聽聽聽聽聽聽 StringWriter writer = new StringWriter();<br />聽聽聽聽聽聽聽聽聽聽聽 int bytes_read;<br />聽聽聽聽聽聽聽聽聽聽聽 while ((bytes_read = reader.read(buffer)) != -1) {<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 writer.write(buffer, 0, bytes_read);<br />聽聽聽聽聽聽聽聽聽聽聽 }<br />聽聽聽聽聽聽聽聽聽聽聽 return (writer.toString());<br />聽聽聽聽聽聽聽 } finally {<br />聽聽聽聽聽聽聽聽聽聽聽 if (null != is)<br />聽聽聽聽聽聽聽聽聽聽聽聽聽聽聽 is.close();<br />聽聽聽聽聽聽聽 }<br />聽聽聽 }<br />鏈鍚庤皟鐢╲elocity鐨勬柟娉?br />Velocity.evaluate(Context context, java.io.Writer out, java.lang.String logTag, java.lang.String instring) <br />浠庤岀敓鎴愭枃浠躲傚眳鐒朵笉鐭ラ亾velocity鏈夎繖鏍風(fēng)殑鏂規(guī)硶錛屾尯鏃犵煡鐨勶紝涓轟簡(jiǎn)璺緞鐒﹀ご鐑傞錛岀粓浜庡緱瑙d簡(jiǎn)銆傛葷粨涓涓嬫妧宸э細(xì)<br />1銆乆object.class.getClassLoader().getResourceAsStream("/templates/xx.vm")鐩稿璺緞鑾峰緱嫻侊紱<br />2銆乂elocity.evaluate(...)鏂規(guī)硶浣跨敤錛?/font> <img src ="http://m.tkk7.com/patterns/aggbug/84041.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/patterns/" target="_blank">閲庤崏</a> 2006-11-28 14:21 <a href="http://m.tkk7.com/patterns/archive/2006/11/28/velocity_template_path_another_method.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鍦╦sp涓嬌鐢╢ckeditor 2.3http://m.tkk7.com/patterns/archive/2006/11/03/integrate_fckeditor_jsp.html閲庤崏閲庤崏Fri, 03 Nov 2006 03:00:00 GMThttp://m.tkk7.com/patterns/archive/2006/11/03/integrate_fckeditor_jsp.htmlhttp://m.tkk7.com/patterns/comments/77356.htmlhttp://m.tkk7.com/patterns/archive/2006/11/03/integrate_fckeditor_jsp.html#Feedback0http://m.tkk7.com/patterns/comments/commentRss/77356.htmlhttp://m.tkk7.com/patterns/services/trackbacks/77356.html 涓嬭澆

浠?span lang="EN-US">FCKeditor鐨勫畼鏂圭珯鐐?a >http://www.fckeditor.net/download涓婁笅杞紽CKeditor 2.3.2鍜孎CKeditor.Java錛屽叾涓璅CKeditor 2.3.2鏄簮鐮侊紝FCKeditor.Java鏄湪jsp涓嬌鐢ㄧ殑渚嬬▼銆?o:p>

鐦﹁韓

灝?span lang="EN-US">FCKeditor 2.3.2瑙e帇鍒癋CKeditor鏂囦歡澶癸紝鐒跺悗鍒犻櫎濡備笅鏂囦歡鎴栫洰褰曪細(xì)

1銆?_samples錛?_testcases錛?o:p>

2銆佸垹闄?_documentation.html,_whatsnew.html,fckeditor.afp,fckeditor.asp,fckeditor.cfc,fckeditor.cfm,
fckeditor.lasso,fckeditor.php,fckeditor.pl,fckeditor.py
鍙墿涓媐ckconfig.js,fckeditor.js,fckstyles.xml,fcktemplates.xml,htaccess.txt,license.txt錛?o:p>

3銆?editor/_source錛?o:p>

4銆?editor/filemanager/browser/default/connectors錛?o:p>

5銆?editor/filemanager/upload錛?o:p>

6銆佽璦鍖?editor/lang涓彧鐣欎笅en.js銆亃h-cn.js錛?o:p>

鍝堝搱錛屼竴涓嬪瓙浠?span lang="EN-US">2.5M鐦﹀埌832K錛岀埥鍛錛佽繕鍙互鍦ㄧ毊鑲ゅ寘閲?editor/skins鍔ㄥ姩鑴戠瓔錛屾瘮濡傚彧鐣欎竴涓猻liver錛岃繖涓ソ閰嶈壊銆?o:p>

閰嶇疆

灝?span lang="EN-US">FCKeditor鐨刯sp涓嬌鐢ㄧ殑渚嬬▼鍜孎CKeditor婧愮爜緇撳悎璧鋒潵錛岃В鍘婩CKeditor.Java錛屽皢瑙e帇鏂囦歡澶逛腑web鐩綍涓嬬殑鎵鏈夋枃浠舵嫹璐濆埌FCKeditor鐩綍涓紝榪欐牱鍦‵CKeditor鐩綍澶氫簡(jiǎn)涓や釜鐩綍錛?o:p>

鈹溾攢_samples

鈹?span lang="EN-US">鈹?span style="mso-spacerun: yes">聽 index.jsp

鈹?span lang="EN-US">鈹?span style="mso-spacerun: yes">聽 sample.css

鈹?span lang="EN-US">鈹?span style="mso-spacerun: yes">聽 sampleslist.jsp

鈹?span lang="EN-US">鈹?span style="mso-spacerun: yes">聽

鈹?span lang="EN-US">鈹斺攢jsp

鈹?span lang="EN-US">聽聽聽聽聽聽聽聽聽 sample01.jsp

鈹?span lang="EN-US">聽聽聽聽聽聽聽聽聽 sample02.jsp

鈹?span lang="EN-US">聽聽聽聽聽聽聽聽聽 sample03.jsp

鈹?span lang="EN-US">聽聽聽聽聽聽聽聽聽 sample04.jsp

鈹?span lang="EN-US">聽聽聽聽聽聽聽聽聽 sample05.jsp

鈹?span lang="EN-US">聽聽聽聽聽聽聽聽聽 sample06.config.js

鈹?span lang="EN-US">聽聽聽聽聽聽聽聽聽 sample06.jsp

鈹?span lang="EN-US">聽聽聽聽聽聽聽聽聽 sample07.jsp

鈹?span lang="EN-US">聽聽聽聽聽聽聽聽聽 sampleposteddata.jsp

鈹?span lang="EN-US">聽聽聽聽聽聽聽聽聽

鈹斺攢WEB-INF

聽聽聽 鈹?span style="mso-spacerun: yes">聽 web.xml

聽聽聽 鈹?span style="mso-spacerun: yes">聽

聽聽聽 鈹斺攢lib

聽聽聽聽聽聽聽聽聽聽聽 FCKeditor-2.3.jar

聽聽聽聽聽聽聽聽聽聽聽 commons-fileupload.jar

鐪嬩竴涓?span lang="EN-US">web.xml鏂囦歡錛岄噷闈㈠鍔犱簡(jiǎn)鏂囦歡嫻忚鍜屾枃浠朵笂浼犲緱servlet銆?o:p>

l聽聽聽聽聽聽聽聽 淇敼鏂囦歡FCKeditor/fckconfig.js

1銆?span style="FONT: 7pt 'Times New Roman'">聽 淇敼灞炴?span lang="EN-US">

涓枃錛?span lang="EN-US">FCKConfig.DefaultLanguage聽聽聽聽 = 'zh-cn' ;

鐨偆錛?span lang="EN-US">FCKConfig.SkinPath = FCKConfig.BasePath + 'skins/default/' ;

2銆?span style="FONT: 7pt 'Times New Roman'">聽 浣跨敤servlet鍋氭枃浠舵祻瑙堝拰涓婁紶

鍙傝?span lang="EN-US">http://wiki.fckeditor.net/Developer%27s_Guide/Integration/Java

//browser

FCKConfig.LinkBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Connector=connectors/jsp/connector" ;

FCKConfig.ImageBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Image&Connector=connectors/jsp/connector" ;

FCKConfig.FlashBrowserURL = FCKConfig.BasePath + "filemanager/browser/default/browser.html?Type=Flash&Connector=connectors/jsp/connector" ;

//upload

FCKConfig.LinkUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=File' ;

FCKConfig.FlashUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Flash' ;

FCKConfig.ImageUploadURL = FCKConfig.BasePath + 'filemanager/upload/simpleuploader?Type=Image' ;

l聽聽聽聽聽聽聽聽 淇敼web.xml澧炲姞FCKeditor鐨則aglib

浠?span lang="EN-US">FCKeditor.Java瑙e帇鐩綍/src鐩綍涓嬫嫹璐滷CKeditor.tld鏂囦歡鍒癢EB-INF鐩綍涓嬶紝鍦╳eb.xml鏂囦歡涓鍔狅細(xì)

<taglib>

聽聽聽 <taglib-uri>/WEB-INF/FCKeditor.tld</taglib-uri>

聽聽聽 <taglib-location>/WEB-INF/FCKeditor.tld</taglib-location>

</taglib>

浣跨敤

鍦?/span> jsp 欏甸潰涓綔濡備笅璋冪敤錛堝叿浣撳浣曚嬌鐢ㄥ彲浠ョ湅 FCKeditor.tld瀹氫箟 錛夛細(xì)

...

<%@ taglib uri="/WEB-INF/FCKeditor.tld" prefix="FCK" %>

...

<FCK:editor id="EditorDefault" basePath="/FCKeditor/">

This is FCKeditor demo!

</FCK:editor>

...

榪愯渚嬬▼

灝嗘垜浠慨鏀逛簡(jiǎn)鍗婂ぉ鐨勬暣涓?/span> FCKeditor鐩綍鎷瘋礉鍒皌omcat5.0.28錛堟垨鍏朵粬web鏈嶅姟鍣級(jí)鐨剋ebapps鐩綍涓嬶紝鍚姩tomcat璁塊棶http://localhost:8080/FCKeditor/_samples/ 璇曠敤涓涓婩CKeditor 2.3.2鐨勫己澶у姛鑳斤紝鏈変簡(jiǎn)demo鍦ㄩ」鐩腑濡備綍浣跨敤錛屼綘鑷繁鐞㈢(鍚э紒

渚嬬▼涓嬭澆錛?/span> FCKeditor



閲庤崏 2006-11-03 11:00 鍙戣〃璇勮
]]>
struts涓笉璁╅〉闈㈣煩杞殑灝忔柟娉?/title><link>http://m.tkk7.com/patterns/archive/2006/10/20/struts_deny_redirect.html</link><dc:creator>閲庤崏</dc:creator><author>閲庤崏</author><pubDate>Fri, 20 Oct 2006 09:43:00 GMT</pubDate><guid>http://m.tkk7.com/patterns/archive/2006/10/20/struts_deny_redirect.html</guid><wfw:comment>http://m.tkk7.com/patterns/comments/76426.html</wfw:comment><comments>http://m.tkk7.com/patterns/archive/2006/10/20/struts_deny_redirect.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/patterns/comments/commentRss/76426.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/patterns/services/trackbacks/76426.html</trackback:ping><description><![CDATA[ <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">浣跨敤</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> struts </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">鍋氶」鐩椂錛岄氬父鍦ㄤ俊鎭綍鍏ラ〉闈㈢偣鍑?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> [ </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">淇濆瓨</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> ] </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">鎸夐挳鍚庝細(xì)璺寵漿鍒頒竴涓滀繚瀛樻垚鍔燂紒鈥濈殑鎻愮ず欏甸潰錛屽皬灝忕殑鎻愮ず浼?xì)甯︽潵涓浜涢棶棰橈細(xì)</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> </span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /?> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; TEXT-ALIGN: left; tab-stops: list 21.0pt; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-font-kerning: 0pt">l</span> <span lang="EN-US" style="FONT-SIZE: 7pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt">聽聽聽聽聽聽聽聽 </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">澶氳璁′竴涓〉闈紱</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> </span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; TEXT-ALIGN: left; tab-stops: list 21.0pt; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-font-kerning: 0pt">l</span> <span lang="EN-US" style="FONT-SIZE: 7pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt">聽聽聽聽聽聽聽聽 </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">鐢ㄦ埛澶氬鍔犱竴姝ユ搷浣滐紙鐗瑰埆鏄湪淇℃伅淇敼欏甸潰錛夛紱</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> </span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 21pt; TEXT-INDENT: -21pt; TEXT-ALIGN: left; tab-stops: list 21.0pt; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings; mso-font-kerning: 0pt">l</span> <span lang="EN-US" style="FONT-SIZE: 7pt; mso-fareast-font-family: Wingdings; mso-font-kerning: 0pt">聽聽聽聽聽聽聽聽 </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">甯︽潵欏甸潰鍒鋒柊鐨勯噸澶嶆彁浜ょ殑闂錛?/span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> </span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 12pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">鎴戜滑鏀瑰彉涓涓嬫濊礬浼?xì)甯︽潵鎰忔兂涓嶅埌鐨勬晥鏋滃Q屽悓鏃朵篃瑙勯伩浜?jiǎn)浠ヤ笂闂銆?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <br /> </span> <b> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-bidi-font-size: 12.0pt; mso-font-kerning: 0pt">鏂規(guī)硶涓</span> </b> <span lang="EN-US" style="FONT-SIZE: 12pt; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">聽</span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; TEXT-ALIGN: left; tab-stops: list 18.0pt; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">1銆?/span> <span lang="EN-US" style="FONT-SIZE: 7pt; mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 0pt">聽 </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">淇敼浣犵殑淇℃伅褰曞叆欏甸潰錛屽姞鍏ュ涓嬭剼鏈?/span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> </span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p> </p> <table class="MsoNormalTable" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellspacing="0" cellpadding="0" border="1"> <tbody> <tr style="mso-yfti-irow: 0; mso-yfti-lastrow: yes"> <td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 426.1pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" valign="top" width="568"> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">鈥︹?/span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"><iframe name="tagFrame" style="display:none" frameborder="0"></iframe></span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">鈥︹?/span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"><script language="JavaScript"></span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"><!--</span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">// </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">淇濆瓨淇℃伅</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> </span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">function saveInfo() {</span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <span style="mso-tab-count: 1">聽聽聽 </span>testForm.action="test.do?method=save";<span style="mso-tab-count: 1">聽 </span></span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <span style="mso-tab-count: 1">聽聽聽 </span>testForm.target="tagFrame";</span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <span style="mso-tab-count: 1">聽聽聽 </span>testForm.submit();</span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">}</span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">//--></span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"></script></span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> </span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p>聽</o:p> </span> </p> </td> </tr> </tbody> </table> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p>聽</o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; TEXT-ALIGN: left; tab-stops: list 18.0pt; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-fareast-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">2銆?/span> <span lang="EN-US" style="FONT-SIZE: 7pt; mso-fareast-font-family: 'Times New Roman'; mso-font-kerning: 0pt">聽 </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">淇敼浣犵殑鎻愮ず欏甸潰</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> </span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p> </p> <table class="MsoNormalTable" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellspacing="0" cellpadding="0" border="1"> <tbody> <tr style="mso-yfti-irow: 0; mso-yfti-lastrow: yes"> <td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 426.1pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" valign="top" width="568"> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"><%@ page contentType="text/html; charset=GBK" %></span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p>聽</o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"><script language="javascript"></span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <span style="mso-tab-count: 1">聽聽聽 </span>alert(" </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">淇濆瓨鎴愬姛錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> "); </span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <span style="mso-tab-count: 1">聽聽聽 </span>// </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">榪欓噷鏄瓑寰呬綘鐐瑰嚮</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> alert </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">鐨勭‘瀹氭寜閽悗璺寵漿錛岀濂囩殑</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> js </span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <span style="mso-tab-count: 1">聽聽聽 </span>parent.window.location.href='test.do?method=test';</span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"></script></span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> </td> </tr> </tbody> </table> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">綆鍗曟敼涓涓嬪氨</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> jsp </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">鏀惰幏榪樹笉灝忋?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <br /> </span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <br /> </span> <b> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-bidi-font-size: 12.0pt; mso-font-kerning: 0pt">鏂規(guī)硶浜?/span> </b> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt">聽<br />璁゛ction榪斿洖javascript瀹屾垚鎻愮ず鍜岃煩杞細(xì)<o:p></o:p></span> </p> <p> </p> <table class="MsoNormalTable" style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellspacing="0" cellpadding="0" border="1"> <tbody> <tr style="mso-yfti-irow: 0; mso-yfti-lastrow: yes"> <td style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 1pt solid; WIDTH: 426.1pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" valign="top" width="568"> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt">public ActionForward execute(ActionMapping mapping, <o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 60pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-char-indent-count: 6.0" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt">ActionForm form, HttpServletRequest request,<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <span style="mso-spacerun: yes">聽聽聽聽聽聽聽聽聽聽聽 </span>HttpServletResponse response) throws Exception {<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 40pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-char-indent-count: 4.0" align="left"> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-font-kerning: 0pt">銆傘傘?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 40pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-char-indent-count: 4.0" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt">// </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-font-kerning: 0pt">鍙戦佺殑淇℃伅</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <span style="mso-spacerun: yes">聽聽聽聽聽聽聽 </span>String msg = "alert('</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: 'Times New Roman'; mso-hansi-font-family: 'Times New Roman'; mso-bidi-font-family: Arial; mso-font-kerning: 0pt">鎿嶄綔鎴愬姛錛?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt">');location.href='test.do?method=test';";<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <span style="mso-spacerun: yes">聽聽聽聽聽聽聽 </span>writeJsToFrontPage(response, msg);<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p>聽</o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <span style="mso-spacerun: yes">聽聽聽聽聽聽聽 </span>return null;<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt">}<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <br /> </span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt">/**<br />聽聽聽聽 * </span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 0pt">鍚戝墠绔〉闈㈠彂閫?/span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt">javascript</span> <span style="FONT-SIZE: 10pt; FONT-FAMILY: 瀹嬩綋; mso-ascii-font-family: Arial; mso-hansi-font-family: Arial; mso-bidi-font-family: Arial; mso-font-kerning: 0pt">鑴氭湰</span> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <br />聽聽聽聽 * <br />聽聽聽聽 * @param response<br />聽聽聽聽 * @param text<br />聽聽聽聽 * @throws IOException<br />聽聽聽聽 */聽</span> <span lang="EN-US" style="FONT-SIZE: 12pt; FONT-FAMILY: 瀹嬩綋; mso-bidi-font-family: 瀹嬩綋; mso-font-kerning: 0pt"> <o:p> </o:p> </span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt">protected void writeJsToFrontPage(HttpServletResponse response, <o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-INDENT: 210pt; TEXT-ALIGN: left; mso-pagination: widow-orphan; mso-char-indent-count: 21.0" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt">String msg) throws IOException {<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <span style="mso-spacerun: yes">聽聽聽聽聽聽聽 </span>response.setContentType("text/html; charset=utf-8");<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <span style="mso-spacerun: yes">聽聽聽聽聽聽聽 </span>response.setHeader("Cache-Control", "no-cache");<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <span style="mso-spacerun: yes">聽聽聽聽聽聽聽 </span>PrintWriter pw = response.getWriter();<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <span style="mso-spacerun: yes">聽聽聽聽聽聽聽 </span>pw.write("<SCRIPT TYPE='text/javascript'>" + msg + "</SCRIPT>");<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <span style="mso-spacerun: yes">聽聽聽聽聽聽聽 </span>pw.close();<o:p></o:p></span> </p> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt; TEXT-ALIGN: left; mso-pagination: widow-orphan" align="left"> <span lang="EN-US" style="FONT-SIZE: 10pt; FONT-FAMILY: Arial; mso-font-kerning: 0pt"> <span style="mso-spacerun: yes">聽聽聽 </span>}<o:p></o:p></span> </p> </td> </tr> </tbody> </table> <p class="MsoNormal" style="MARGIN: 0cm 0cm 0pt"> <span lang="EN-US"> <o:p>聽</o:p> </span> </p> <img src ="http://m.tkk7.com/patterns/aggbug/76426.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/patterns/" target="_blank">閲庤崏</a> 2006-10-20 17:43 <a href="http://m.tkk7.com/patterns/archive/2006/10/20/struts_deny_redirect.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>velocity1.4鍦ㄤ俊鎭彂甯冧腑鐨勪嬌鐢?/title><link>http://m.tkk7.com/patterns/archive/2006/03/08/velocity1_4InPublishInfo.html</link><dc:creator>閲庤崏</dc:creator><author>閲庤崏</author><pubDate>Wed, 08 Mar 2006 13:09:00 GMT</pubDate><guid>http://m.tkk7.com/patterns/archive/2006/03/08/velocity1_4InPublishInfo.html</guid><wfw:comment>http://m.tkk7.com/patterns/comments/34353.html</wfw:comment><comments>http://m.tkk7.com/patterns/archive/2006/03/08/velocity1_4InPublishInfo.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.tkk7.com/patterns/comments/commentRss/34353.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/patterns/services/trackbacks/34353.html</trackback:ping><description><![CDATA[<P dir=ltr style="MARGIN-RIGHT: 0px"><FONT size=2><FONT face=Georgia>榪戞潵鍋氫簡(jiǎn)涓涓畝鍗曠殑淇℃伅鍙戝竷妯″潡錛?STRONG>鍔熻兘濡備笅錛?/STRONG><BR><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">        </SPAN></SPAN></SPAN></FONT></FONT><FONT size=2><FONT face=Georgia>淇℃伅鏄劇ず<BR><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">        </SPAN></SPAN></SPAN></FONT></FONT><FONT size=2><FONT face=Georgia>淇℃伅鎿嶄綔<BR><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">  n<SPAN style="FONT: 7pt 'Times New Roman'">        </SPAN></SPAN></SPAN></FONT></FONT><FONT size=2><FONT face=Georgia>鏂板<BR><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">  n<SPAN style="FONT: 7pt 'Times New Roman'">        </SPAN></SPAN></SPAN></FONT></FONT><FONT size=2><FONT face=Georgia>淇敼<BR><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">  n<SPAN style="FONT: 7pt 'Times New Roman'">        </SPAN></SPAN></SPAN></FONT></FONT><FONT size=2><FONT face=Georgia>鍒犻櫎<BR><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">        </SPAN></SPAN></SPAN></FONT></FONT><FONT size=2><FONT face=Georgia>淇℃伅鏌ヨ<BR><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">l<SPAN style="FONT: 7pt 'Times New Roman'">        </SPAN></SPAN></SPAN></FONT></FONT><FONT size=2><FONT face=Georgia>妯℃澘綆$悊<BR><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">  n<SPAN style="FONT: 7pt 'Times New Roman'">        </SPAN></SPAN></SPAN></FONT></FONT><FONT size=2><FONT face=Georgia>涓嬭澆<BR><SPAN lang=EN-US style="FONT-FAMILY: Wingdings; mso-fareast-font-family: Wingdings; mso-bidi-font-family: Wingdings"><SPAN style="mso-list: Ignore">  n<SPAN style="FONT: 7pt 'Times New Roman'">        </SPAN></SPAN></SPAN>涓婁紶<BR><SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></FONT></P> <P><FONT size=2><FONT face=Georgia><STRONG>鍩烘湰鎬濊礬錛?/STRONG><BR>         鍦ㄤ俊鎭柊澧炴椂瀵逛俊鎭繘琛屼袱涓柟闈㈢殑淇濆瓨錛?銆佷繚瀛樺埌鏁版嵁搴擄紝鐩殑渚夸簬淇℃伅鐨勪慨鏀癸紱2銆佷嬌鐢╲elocity鐢熸垚闈?rùn)鎬佺殑html鏂囦歡錛屼互渚挎祻瑙堛傜敤鎴峰彲浠ヤ笅杞絭elocity鐨勨?vm鈥濇ā鏉匡紝鐢辯▼搴忚漿鍙樻垚鈥?html鈥濇枃浠剁粰鐢ㄦ埛錛岀敤鎴蜂慨鏀癸紙鍙互鍔犱笂css淇グ錛夊悗灝嗏?html鈥濇枃浠朵笂浼狅紝鐢辯▼搴忚漿鍙樻垚鈥?vm鈥濇枃浠舵斁鍒皏elocity璋冪敤鐨勬ā鏉跨洰褰曚腑銆?BR><BR></FONT></FONT><FONT size=2><FONT face=Georgia><STRONG>閬囧埌闂錛?BR></STRONG>1銆乴og鏂囦歡鐢熸垚闂錛?BR>2銆佺紪鐮侀棶棰橈紱<BR>3銆佹ā鏉胯礬寰勯棶棰橈紱<BR><BR><BR></FONT></FONT><FONT size=2><FONT face=Georgia><STRONG>瑙e喅鏂規(guī)硶錛?BR></STRONG>鍦╲elocity鍒濆鍖栨椂錛屾坊鍔犱互涓嬪睘鎬ч厤緗細(xì)<BR></FONT></FONT></P> <P><FONT face=Georgia size=2></FONT></P><FONT face=Georgia size=2> <HR> </FONT> <P></P> <P><FONT face=Georgia size=2>  // 璁劇疆velocity鐨刲og<BR>  Velocity.setProperty(Velocity.RUNTIME_LOG, <STRONG>mainPath</STRONG> + File.separator + "velocity.log");<BR><BR>  // 璁劇疆velocity鐨勮緭鍏ヨ緭鍑虹紪鐮?BR>  Velocity.setProperty(Velocity.INPUT_ENCODING, "GBK");<BR>  Velocity.setProperty(Velocity.OUTPUT_ENCODING, "GBK");<BR><BR>  // / 璁劇疆velocity鐨勬ā鏉胯礬寰勶紙蹇呰錛?BR>  Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, <STRONG>mainPath</STRONG> + File.separator + "template";</FONT></P> <P><FONT face=Georgia size=2>  // 鍒濆鍖杤elocity寮曟搸<BR>  try {<BR>   Velocity.init();<BR>  } catch (Exception e) {   <BR>   e.printStackTrace();<BR>  } <HR> </FONT> <P></P> <P><FONT size=2><FONT face=Georgia>鍏朵腑mainPath 鎸囦綘鐨勫簲鐢ㄥ彂甯冪洰褰曟垨鍏朵粬浠諱綍涓涓湁鏉冮檺浣跨敤鐩綍錛屽彲鐢遍厤緗枃浠跺畾涔夈?BR><BR><STRONG>闂鍒嗘瀽錛?/STRONG></FONT></FONT></P> <P><FONT face=Georgia size=2>1銆?鐐逛笉鐢ㄨ浜?jiǎn)锛岃璇唇W?鐐廣備竴寮濮嬫垜鍦ㄨ皟鐢ㄦā鏉挎椂浣跨敤緇濆璺緞鍜岀浉瀵硅礬寰勶紝鍙槸鎬庝箞嫻嬭瘯灝辨槸涓嶈錛屾繪槸鎶ワ細(xì)Unable to find resource銆傛煡鐪嬩簡(jiǎn)涓涓嬫簮鐮侊紝velocity璋冪敤鐨勬槸FileResourceLoader錛岄儴鍒嗘簮鐮佸涓嬶細(xì)</P> <P> <HR> <P></P> <P>public void init( ExtendedProperties configuration)<BR>    {<BR>        rsvc.info("FileResourceLoader : initialization starting.");<BR>        <BR>     <STRONG>   paths = configuration.getVector("path");</STRONG><BR>        <BR>        /*<BR>         *  lets tell people what paths we will be using<BR>         */</P> <P>        int sz = paths.size();</P> <P>        for( int i=0; i < sz; i++)<BR>        {<BR>            rsvc.info("FileResourceLoader : adding path '" + (String) paths.get(i) + "'");<BR>        }</P> <P>        rsvc.info("FileResourceLoader : initialization complete.");<BR>    }</P> <P>    /**<BR>     * Get an InputStream so that the Runtime can build a<BR>     * template with it.<BR>     *<BR>     * @param name name of template to get<BR>     * @return InputStream containing the template<BR>     * @throws ResourceNotFoundException if template not found<BR>     *         in the file template path.<BR>     */<BR>    public synchronized InputStream getResourceStream(String templateName)<BR>        throws ResourceNotFoundException<BR>    {<BR>        /*<BR>         * Make sure we have a valid templateName.<BR>         */<BR>        if (templateName == null || templateName.length() == 0)<BR>        {<BR>            /*<BR>             * If we don't get a properly formed templateName then<BR>             * there's not much we can do. So we'll forget about<BR>             * trying to search any more paths for the template.<BR>             */<BR>            throw new ResourceNotFoundException(<BR>                "Need to specify a file name or file path!");<BR>        }</P> <P>        String template = StringUtils.normalizePath(templateName);<BR>        if ( template == null || template.length() == 0 )<BR>        {<BR>            String msg = "File resource error : argument " + template + <BR>                " contains .. and may be trying to access " + <BR>                "content outside of template root.  Rejected.";</P> <P>            rsvc.error( "FileResourceLoader : " + msg );<BR>      <BR>            throw new ResourceNotFoundException ( msg );<BR>        }</P> <P>        /*<BR>         *  if a / leads off, then just nip that :)<BR>         */<BR>        if (template.startsWith("/"))<BR>        {<BR>            template = template.substring(1);<BR>        }</P> <P>        int size = paths.size();<BR>        for (int i = 0; i < size; i++)<BR>        {<BR>            <STRONG>String path = (String) paths.get(i);<BR></STRONG>            InputStream inputStream = findTemplate(path, template);<BR>            <BR>            if (inputStream != null)<BR>            {<BR>                /*<BR>                 * Store the path that this template came<BR>                 * from so that we can check its modification<BR>                 * time.<BR>                 */</P> <P>                templatePaths.put(templateName, path);<BR>                return inputStream;<BR>            }                <BR>        }<BR>    <BR>        /*<BR>         * We have now searched all the paths for<BR>         * templates and we didn't find anything so<BR>         * throw an exception.<BR>         */<BR>         String msg = "FileResourceLoader Error: cannot find resource " +<BR>          template;<BR>    <BR>         throw new ResourceNotFoundException( msg );<BR>    }</P> <P> <HR> <P></P> <P>鍙浣?STRONG>涓瀹氳</STRONG>璁劇疆</P> <P> <HR> <P></P> <P>// / 璁劇疆velocity鐨勬ā鏉胯礬寰勶紙蹇呰錛?BR>  Velocity.setProperty(Velocity.FILE_RESOURCE_LOADER_PATH, <STRONG>mainPath</STRONG> + File.separator + "template"; <HR> <P></P> <P><BR></P></FONT><img src ="http://m.tkk7.com/patterns/aggbug/34353.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/patterns/" target="_blank">閲庤崏</a> 2006-03-08 21:09 <a href="http://m.tkk7.com/patterns/archive/2006/03/08/velocity1_4InPublishInfo.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>浣跨敤struts鐨勫悓姝ヤ護(hù)鐗岄伩鍏峟orm鐨勯噸澶嶆彁浜?/title><link>http://m.tkk7.com/patterns/archive/2006/03/08/useStrutsToken.html</link><dc:creator>閲庤崏</dc:creator><author>閲庤崏</author><pubDate>Wed, 08 Mar 2006 13:07:00 GMT</pubDate><guid>http://m.tkk7.com/patterns/archive/2006/03/08/useStrutsToken.html</guid><wfw:comment>http://m.tkk7.com/patterns/comments/34352.html</wfw:comment><comments>http://m.tkk7.com/patterns/archive/2006/03/08/useStrutsToken.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://m.tkk7.com/patterns/comments/commentRss/34352.html</wfw:commentRss><trackback:ping>http://m.tkk7.com/patterns/services/trackbacks/34352.html</trackback:ping><description><![CDATA[<P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1"><B><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>涓銆佷嬌鐢ㄦ柟娉?SPAN lang=EN-US><?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></FONT></FONT></SPAN></B></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><FONT face=Arial><FONT size=2><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋">1銆?SPAN style="FONT: 7pt 'Times New Roman'">  </SPAN></SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋">鍋囧浣犺鎻愪氦鐨勯〉闈負(fù)<SPAN lang=EN-US>toSubmit.jsp錛?o:p></o:p></SPAN></SPAN></FONT></FONT></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><FONT face=Arial><FONT size=2><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋">2銆?SPAN style="FONT: 7pt 'Times New Roman'">  </SPAN></SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋">鍦ㄦ墦寮<SPAN lang=EN-US>toSubmit.jsp鐨凙ction1涓姞鍏ワ細(xì)saveToken(request)錛屼緥濡?o:p></o:p></SPAN></SPAN></FONT></FONT></P> <TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1> <TBODY> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 426.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=569> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>public ActionForward execute(<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>ActionMapping mapping,<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>ActionForm form,<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>HttpServletRequest request,<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>HttpServletResponse response)<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>throws Exception {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN><o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">        </SPAN>//鐢熸垚鍚屾浠ょ墝<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-tab-count: 2">        </SPAN><SPAN style="COLOR: red">saveToken</SPAN>(request);<SPAN style="mso-tab-count: 2">     </SPAN><o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-tab-count: 2">        </SPAN>return mapping.findForward("toSubmit");<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>}<o:p></o:p></FONT></FONT></SPAN></P></TD></TR></TBODY></TABLE> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><FONT face=Arial><FONT size=2><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋">3銆?SPAN style="FONT: 7pt 'Times New Roman'">  </SPAN></SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋">鍦ㄦ彁浜?SPAN lang=EN-US>toSubmit.jsp鐨凙ction2涓姞鍏ワ細(xì)isTokenValid(request, true)錛屼緥濡傦細(xì)<o:p></o:p></SPAN></SPAN></FONT></FONT></P> <TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1> <TBODY> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 426.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=569> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>public ActionForward execute(<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>ActionMapping mapping,<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>ActionForm form,<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>HttpServletRequest request,<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>HttpServletResponse response)<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>throws Exception {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>// 楠岃瘉鍚屾浠ょ墝<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-tab-count: 2">        </SPAN>if (<SPAN style="COLOR: red">isTokenValid</SPAN>(request, true)) {<SPAN style="mso-tab-count: 1">  </SPAN><o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-tab-count: 3">            </SPAN>//鎵ц鎻愪氦鎿嶄綔<SPAN style="mso-tab-count: 1">  </SPAN><o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-tab-count: 2">        </SPAN>}else {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-tab-count: 3">            </SPAN>// 閲嶅鎻愪氦<SPAN style="mso-tab-count: 3">         </SPAN><o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-tab-count: 3">            </SPAN>return mapping.findForward("Error");<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-tab-count: 2">        </SPAN>}<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>}<o:p></o:p></FONT></FONT></SPAN></P></TD></TR></TBODY></TABLE> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt 18pt; TEXT-INDENT: -18pt; mso-list: l0 level1 lfo1; tab-stops: list 18.0pt"><FONT face=Arial><FONT size=2><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋">4銆?SPAN style="FONT: 7pt 'Times New Roman'">  </SPAN></SPAN><SPAN style="FONT-FAMILY: 瀹嬩綋">浣跨敤娉ㄦ剰錛?SPAN lang=EN-US>toSubmit.jsp涓殑form蹇呴』浣跨敤struts鐨勬爣絳?lt;html:form>銆?o:p></o:p></SPAN></SPAN></FONT></FONT></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt; mso-outline-level: 1"><B><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>浜屻佸熀鏈師鐞?SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></SPAN></B></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>絎竴姝ャ佸湪<SPAN lang=EN-US>session涓斁鍏ュ悓姝ヤ護(hù)鐗?o:p></o:p></SPAN></FONT></FONT></SPAN></B></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>鍦?SPAN lang=EN-US>Action1涓姞鍏ヤ簡(jiǎn)saveToken(request)鐨勬柟娉曞悗錛岃皟鐢═okenProcessor綾葷殑saveToken鏂規(guī)硶濡備笅錛?o:p></o:p></SPAN></FONT></FONT></SPAN></P> <TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1> <TBODY> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 426.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=569> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>public synchronized void saveToken(HttpServletRequest request) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>HttpSession session = request.getSession();<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>String token = generateToken(request);<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>if (token != null) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">        </SPAN><SPAN style="COLOR: red">session.setAttribute(Globals.TRANSACTION_TOKEN_KEY, token)</SPAN>;<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>}<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>}<B><o:p></o:p></B></FONT></FONT></SPAN></P></TD></TR></TBODY></TABLE> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>寰堟槑鏄懼湪<SPAN lang=EN-US>session涓斁鍏ヤ簡(jiǎn)鍚屾浠ょ墝錛屽悕縐頒負(fù)Globals.TRANSACTION_TOKEN_KEY銆?o:p></o:p></SPAN></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>絎簩姝ャ佸湪欏甸潰鍒涘緩<SPAN lang=EN-US>hidden鍏冪礌<o:p></o:p></SPAN></FONT></FONT></SPAN></B></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>褰撳簲鐢ㄦ湇鍔″櫒鍒濆鍖?SPAN lang=EN-US>toSubmit.jsp欏甸潰閬囧埌鏍囩<html:form>鏃訛紝渚夸細(xì)璋冪敤struts鐨凢ormTag綾伙紝鍏朵腑鏈変竴涓柟娉曪細(xì)<o:p></o:p></SPAN></FONT></FONT></SPAN></P> <TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1> <TBODY> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 426.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=569> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>protected String renderToken() {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>StringBuffer results = new StringBuffer();<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>HttpSession session = pageContext.getSession();<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>if (session != null) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">        </SPAN>String token =<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">            </SPAN>(String) session.getAttribute(Globals.TRANSACTION_TOKEN_KEY);<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">     </SPAN><SPAN style="mso-spacerun: yes">       </SPAN><o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">        </SPAN>if (<SPAN style="COLOR: red">token != null</SPAN>) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">            </SPAN>results.append("<input type=\"hidden\" name=\"");<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">            </SPAN>results.append(Constants.TOKEN_KEY);<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">            </SPAN>results.append("\" value=\"");<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">            </SPAN>results.append(token);<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">            </SPAN>if (this.isXhtml()) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">                </SPAN>results.append("\" />");<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">            </SPAN>} else {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">                </SPAN>results.append("\">");<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">            </SPAN>}<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">        </SPAN>}<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>}<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>return results.toString();<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>}<o:p></o:p></FONT></FONT></SPAN></P></TD></TR></TBODY></TABLE> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>鍏舵剰涓猴細(xì)褰撴嫻嬪埌<SPAN lang=EN-US>session涓殑Globals.TRANSACTION_TOKEN_KEY涓嶄負(fù)絀烘椂錛屽湪toSubmit.jsp欏甸潰鍒涘緩鍏冪礌錛?o:p></o:p></SPAN></FONT></FONT></SPAN></P> <TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1> <TBODY> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 426.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=569> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><input type="hidden" name="org.apache.struts.taglib.html.TOKEN" value=""><o:p></o:p></FONT></FONT></SPAN></P></TD></TR></TBODY></TABLE> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>鍚嶇О涓猴細(xì)<SPAN lang=EN-US>org.apache.struts.taglib.html.TOKEN灝辨槸Constants.TOKEN_KEY錛?o:p></o:p></SPAN></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>鍊間負(fù)錛?SPAN lang=EN-US>session涓殑Globals.TRANSACTION_TOKEN_KEY鐨勫鹼紝鍗充負(fù)鍚屾浠ょ墝鍊箋?o:p></o:p></SPAN></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><B><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>絎笁姝ャ侀獙璇佸悓姝ヤ護(hù)鐗?SPAN lang=EN-US><o:p></o:p></SPAN></FONT></FONT></SPAN></B></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>鍦?SPAN lang=EN-US>Action2涓姞鍏sTokenValid鏂規(guī)硶錛屽疄闄呬笂鏄皟鐢═okenProcessor綾葷殑isTokenValid鏂規(guī)硶濡備笅錛?o:p></o:p></SPAN></FONT></FONT></SPAN></P> <TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1> <TBODY> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 426.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=569> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>public synchronized boolean isTokenValid(<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>HttpServletRequest request,<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>boolean reset) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>// Retrieve the current session for this request<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>HttpSession session = request.getSession(false);<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>if (session == null) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">        </SPAN>return false;<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>}<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>// Retrieve the transaction token from this session, and<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>// reset it if requested<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>String saved = <SPAN style="COLOR: red">(String)</SPAN> <SPAN style="COLOR: red">session.getAttribute(Globals.TRANSACTION_TOKEN_KEY)</SPAN>;<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>if (saved == null) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">        </SPAN>return false;<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>}<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>if (reset) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">        </SPAN>this.resetToken(request);<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>}<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>// Retrieve the transaction token included in this request<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>String token = <SPAN style="COLOR: red">request.getParameter(Constants.TOKEN_KEY)</SPAN>;<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>if (token == null) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">        </SPAN>return false;<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>}<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">    </SPAN>return saved.equals(token);<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>}<o:p></o:p></FONT></FONT></SPAN></P></TD></TR></TBODY></TABLE> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>瀹冮鍏堝彇寰?SPAN lang=EN-US>session涓殑浠ょ墝鍊鹼紝鐒跺悗resetToken錛屽啀浠庨〉闈idden鍏冪礌鍙栨潵浠ょ墝鍊鹼紝榪涜姣旇緝錛屽鏋滅浉絳夊垯涓虹涓嬈★紝涓嶇瓑鍒欎負(fù)閲嶅鎻愪氦銆?o:p></o:p></SPAN></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>鍏朵腑<SPAN lang=EN-US>resetToken鏂規(guī)硶濡備笅錛?o:p></o:p></SPAN></FONT></FONT></SPAN></P> <TABLE style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt" cellSpacing=0 cellPadding=0 border=1> <TBODY> <TR> <TD style="BORDER-RIGHT: windowtext 0.5pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 0.5pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0cm; BORDER-LEFT: windowtext 0.5pt solid; WIDTH: 426.4pt; PADDING-TOP: 0cm; BORDER-BOTTOM: windowtext 0.5pt solid; BACKGROUND-COLOR: transparent" vAlign=top width=569> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>public synchronized void resetToken(HttpServletRequest request) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">  </SPAN>HttpSession session = request.getSession(false);<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">  </SPAN>if (session == null) {<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">      </SPAN>return;<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">  </SPAN>}<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2><SPAN style="mso-spacerun: yes">  </SPAN><SPAN style="COLOR: red">session.removeAttribute(Globals.TRANSACTION_TOKEN_KEY)</SPAN>;<o:p></o:p></FONT></FONT></SPAN></P> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2>}<o:p></o:p></FONT></FONT></SPAN></P></TD></TR></TBODY></TABLE> <P class=MsoNormal style="MARGIN: 0cm 0cm 0pt"><SPAN lang=EN-US style="FONT-FAMILY: 瀹嬩綋"><FONT face=Arial><FONT size=2> <o:p></o:p></FONT></FONT></SPAN></P><img src ="http://m.tkk7.com/patterns/aggbug/34352.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.tkk7.com/patterns/" target="_blank">閲庤崏</a> 2006-03-08 21:07 <a href="http://m.tkk7.com/patterns/archive/2006/03/08/useStrutsToken.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Spring + Hibernate + Oracle9i涓嬌鐢–lobhttp://m.tkk7.com/patterns/archive/2006/03/08/spring_hibernate_oracle9i_clob.html閲庤崏閲庤崏Wed, 08 Mar 2006 13:03:00 GMThttp://m.tkk7.com/patterns/archive/2006/03/08/spring_hibernate_oracle9i_clob.htmlhttp://m.tkk7.com/patterns/comments/34351.htmlhttp://m.tkk7.com/patterns/archive/2006/03/08/spring_hibernate_oracle9i_clob.html#Feedback0http://m.tkk7.com/patterns/comments/commentRss/34351.htmlhttp://m.tkk7.com/patterns/services/trackbacks/34351.html鑳屾櫙

鍦ㄤ俊鎭彂甯冪郴緇熶腑錛屽鏋滈渶瑕佸皢鐢ㄦ埛鍙戝竷鐨勪俊鎭繚瀛樺埌Oralcle9i鏁版嵁搴撲腑錛屼嬌鐢?/SPAN>varchar2(4000)鏈夋椂鏄笉澶熺敤鐨勶紝鍥犱負(fù)闄や簡(jiǎn)鐢ㄦ埛褰曞叆鐨勫唴瀹硅繕瑕佸姞涓?/SPAN>html緙栬緫鍣ㄩ檮鍔犵殑html鏍囪瘑錛屾墍浠ユ垜寤鴻浣跨敤clob銆?/SPAN>

鍔ㄦ墜

鍏跺疄涔熸尯綆鍗曠殑錛氫袱涓厤緗佷袱涓敞鎰?/FONT>

1銆?/SPAN>hbm閰嶇疆

<hibernate-mapping>

       <class name="com.wonders.pubinfo.bean.LawInfo" table="JZ_LAW_INFO">

              <id column="ID" name="id" type="java.lang.String">

                     <generator class="uuid.hex"/>

              </id>

              <property column="TYPE" length="4" name="type" type="java.lang.String"/>

              <property column="TITLE" length="200" name="title" type="java.lang.String"/>

              <property column="KEYWORD" length="200" name="keyword" type="java.lang.String"/>

              <property column="CONTENT" name="content" type="org.springframework.orm.hibernate.support.ClobStringType"/>

              <property column="PUBLISH_TIME" length="23" name="publishTime" type="java.sql.Timestamp"/>

              <property column="PRACTICE_TIME" length="23" name="practiceTime" type="java.sql.Timestamp"/>

              <property column="END_TIME" length="23" name="endTime" type="java.sql.Timestamp"/>

              <property column="FILE_NUM" length="50" name="fileNum" type="java.lang.String"/>

              <property column="PUB_ORGAN" length="50" name="pubOrgan" type="java.lang.String"/>

              <property column="TEMPLATE" length="20" name="template" type="java.lang.String"/>

              <property column="VALIDITY" length="1" name="validity" type="java.lang.String"/>

              <property column="HTML_FILE" length="50" name="htmlFile" type="java.lang.String"/>

       </class>

</hibernate-mapping>

2銆?/SPAN>application閰嶇疆

<beans>

       <!--**** Start of PERSISTENCE DEFINITIONS ****-->

  <bean id="placeholderConfig" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">

    <property name="location">

      <value>init.properties</value>

    </property>

  </bean> 

 

  <!-- JDBC Connection -->

  <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource">

    <property name="driverClassName">

      <value>${datasource.driverClassName}</value>

    </property>

    <property name="url">

      <value>${datasource.url}</value>

    </property>

    <property name="username">

      <value>${datasource.username}</value>

    </property>

    <property name="password">

      <value>${datasource.password}</value>

    </property>

    <property name="maxActive">

      <value>${datasource.maxActive}</value>

    </property>

    <property name="maxIdle">

      <value>${datasource.maxIdle}</value>

    </property>

    <property name="maxWait">

      <value>${datasource.maxWait}</value>

    </property>

    <property name="defaultAutoCommit">

      <value>${datasource.defaultAutoCommit}</value>

    </property>

  </bean>

 

  <!--**** OracleLobHandler ****-->

  <bean id="oracleLobHandler" class="org.springframework.jdbc.support.lob.OracleLobHandler">

              <property name="nativeJdbcExtractor">

                     <ref local="nativeJdbcExtractor"/>

              </property>

  </bean>

 

       <bean id="nativeJdbcExtractor" class="org.springframework.jdbc.support.nativejdbc.SimpleNativeJdbcExtractor"></bean>

      

       <!--**** SessionFactory Definition ****-->

       <bean id="sessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">

              <property name="dataSource">

                     <ref local="dataSource" />

              </property>

              <property name="lobHandler">

                     <ref bean="oracleLobHandler" />

              </property>

              <property name="mappingResources">

                     <list>

                            <value>com\wonders\pubinfo\bean\LawInfo.hbm.xml</value>

                            <value>com\wonders\pubinfo\bean\LawType.hbm.xml</value>

                     </list>

              </property>

              <property name="hibernateProperties">

                     <props>

                            <prop key="hibernate.dialect">${hibernate.dialect}</prop>

                            <prop key="hibernate.show_sql">${hibernate.show_sql}</prop>

                            <prop key="hibernate.jdbc.fetch_size">${hibernate.jdbc.fetch_size}</prop>

                            <prop key="hibernate.jdbc.batch_size">${hibernate.jdbc.batch_size}</prop>

                     </props>

              </property>

       </bean>

 

</beans>

3銆佹敞鎰?/SPAN>

錛?/SPAN>1錛夈佹敞鎰忕孩鑹插瓧浣撻儴鍒嗭紝灝辨槸浣犺閰嶇疆鐨勶紱鍦ㄥ紩鐢?/SPAN>spring綾葷殑鍦版柟錛屾敞鎰忔煡鐪嬩竴涓嬩綘浣跨敤鐨?/SPAN>spring鍖呬腑鏈夌殑鍋氱浉搴斾慨鏀廣?/SPAN>

錛?/SPAN>2錛夈佹敞鎰忎嬌鐢ㄧ殑datasource涓瀹氫嬌鐢?/SPAN>NativeJdbcExtractor錛屽氨鏄傜敤jdbc榪炴帴錛屼笉瑕佺敤瀹瑰櫒鎻愪緵榪炴帴錛屼笉鐒朵細(xì)鎶ュ涓嬮敊璇細(xì)

OracleLobCreator needs to work on [oracle.jdbc.OracleConnection], not on [class com.ibm.ws.rsadapter.jdbc.WSJdbcConnection] - specify a corresponding NativeJdbcExtractor

4銆?/SPAN>bean涓殑clob瀛楁浣跨敤String綾誨瀷

public class LawInfo implements Serializable {

       ...

       private String content;

       ...

       public String getContent() {

              return content;

       }

 

       public void setContent(String content) {

              this.content = content;

       }

 

       ...   

}

 



閲庤崏 2006-03-08 21:03 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 十八禁视频在线观看免费无码无遮挡骂过 | 免费在线观看理论片| 亚洲精品视频在线播放| 毛片在线全部免费观看| 亚洲一区二区精品视频| 精品国产_亚洲人成在线| 成人毛片18岁女人毛片免费看| 亚洲免费人成视频观看| 精品熟女少妇av免费久久| 亚洲精品无码av人在线观看| 春意影院午夜爽爽爽免费| 亚洲AⅤ优女AV综合久久久| 香蕉视频亚洲一级| 日本免费人成黄页在线观看视频| 亚洲综合av一区二区三区| 九九精品免费视频| 亚洲人成综合在线播放| 97人妻无码一区二区精品免费| 亚洲综合色一区二区三区小说| 一级毛片免费视频| 久久亚洲精品成人AV| 97视频免费观看2区| 亚洲一区二区在线免费观看| 久久久久久久岛国免费播放| 亚洲一区精品中文字幕| 99久久免费观看| 亚洲色欲或者高潮影院| 97在线视频免费公开观看| 91亚洲国产在人线播放午夜| 91久久青青草原线免费| 亚洲欧洲国产精品久久| AV无码免费永久在线观看| 亚洲一区二区三区播放在线| 国产成人免费高清激情视频| 亚洲中文字幕一二三四区| 永久黄网站色视频免费| 国产成人亚洲精品蜜芽影院| 午夜亚洲福利在线老司机| 中文在线免费看视频| 久久精品亚洲综合| 精品女同一区二区三区免费站|