锘??xml version="1.0" encoding="utf-8" standalone="yes"?>
綰㈤鐭ュ繁灝辨槸涓縐嶇偣鎷紝鐐規嫧浣犲績涓殑榪鋒觸銆?nbsp; 闃呰鍏ㄦ枃
]]>
]]>
閭f槦鏄熺偣鐐圭殑鍏変寒
鏄犺‖椋庨洦鍋ョ杞葷泩鐨勮垶姝?br />
榪介愯嚜鐢卞艦楠哥殑鏀炬氮
鑰屽亸榪滀埂鏉戞矇瀵傚湪鑷劧涓?br />
鍙湁涓鎭井寮辯伅褰卞湪娓呴涓憞鏅?br />
絳夊緟甯屽唨鐨勫啀鐢?br />
娓存湜鍐掑嚭鎷斿湴妤兼埧
浼ら濋殣榪涙ⅵ鐨勫湡澹?br />
]]>
Tomcat5.0.28 + JDK1.5 + xfire1.2.6
欏圭洰浠嶵omcat6.0欏圭洰鎷瘋礉鍥炴潵錛宼omcat6.0榪愯姝e父銆?br />
闂鍑哄湪Tomcat鐨?br />
\common\endorsed\涓?br />
鍒犻櫎鎴朼pache緗戠珯涓嬭澆鏇存柊榪欎袱涓猨ar鍗沖彲銆?br />
In a JDO-enabled application there are 3 categories of classes. These are PersistenceCapable, PersistenceAware and normal classes. The Meta-Data defines which classes fit into these categories. To give an example for JDO, we have 3 classes. The class A is to be persisted in the datastore. The class B directly updates the fields of class A but doesn't need persisting. The class C is not involved in the persistence process. We would define JDO MetaData for these classes like this
So our MetaData is mainly for those classes that are PersistenceCapable and are to be persisted to the datastore (we don't really need the persistence-modifier for thse classes since this is the default). For PersistenceAware classes we simply notate that the class knows about persistence. We don't define MetaData for any class that has no knowledge of persistence.
JDO requires that all classes to be persisted must implement the PersistenceCapable interface . Users could manually do this themselves but this would impose work on them. JDO permits the use of a byte-code enhancer that converts the users normal classes to implement this interface. JPOX provides its own byte-code enhancer (this can be found in the jpox-enhancer.jar). This section describes how to use this enhancer with JPOX. The JPOX enhancer fully implements JDO2 and so is the recommended choice when persisting using the JDO2 API. The enhancement process adds the necessary methods to the users class in order to implement PersistenceCapable.
The example above doesn't show all PersistenceCapable methods, but demonstrates that all added methods and fields are prefixed with "jdo" to distinguish them from the users own methods and fields. Also each persistent field of the class will be given a jdoGetXXX, jdoSetXXX method so that accesses of these fields are intercepted so that JDO can manage their "dirty" state.
The MetaData defines which classes are required to be persisted, and also defines which aspects of persistence each class requires. For example if a class has the detachable attribute set to true, then that class will be enhanced to also implement Detachable
Again, the example above doesn't show all methods added for the Detachable interface but the main thing to know is that the detached state (object id of the datastore object, the version of the datastore object when it was detached, and which fields were detached is stored in "jdoDetachedState"). Please see the JDO spec for more details.
If the MetaData is changed in any way during development, the classes should always be recompiled and re-enhanced afterwards.
Byte-Code Enhancement Myths |
Some groups (e.g Hibernate) perpetuated arguments against "byte-code enhancement" saying that it was somehow 'evil'. The most common were :-
So as you can see, there are no valid reasons against byte-code enhancement, and the pluses are that runtime detection of dirty events on objects is much quicker, hence your persistence layer operates faster without any need for iterative reflection-based checks. The fact is that Hibernate itself also now has a mode whereby you can do bytecode enhancement although not the default mode of Hibernate. So maybe it wasn't so evil after all ?
ActionForm閰嶇疆
璇鋒敞鎰弉ame灞炴э紝榪欎釜灞炴у悗闈㈣鐢ㄥ埌銆?br />
鐒跺悗鏄〉闈ndex.jsp,榪欓噷鍙ā鎷熷姩鎬?/p>
璇鋒敞鎰廻tml:text鐨刾roperty鏍囩銆?br />
index.jsp鏁堟灉濡備笅
鍚庡彴Action
杈撳嚭琛ㄥ崟欏?/p>