JAVA JNI
http://blog.csdn.net/hbcui1984/archive/2009/12/10/4980805.aspx
Ò»¡¢¸ÅÊö
JNI(java native interface)£¬JAVA±¾µØ½Ó¿Úµ÷Óã¬Ä¿µÄÊÇΪÁËJAVA¿ÉÒÔµ÷Óñ¾µØ³ÌÐò£¬Ö÷ÒªÓŵãÓУº
Ìá¸ßЧÂÊ£¬½â¾öÐÔÄÜÎÊÌâ
·ÀÖ¹·´±àÒ룬Ìá¸ßºËÐÄ´úÂ밲ȫÐÔ
ÔöÇ¿±¾»ú½Ó¿Úµ÷ÓÃ
ǶÈëʽ¿ª·¢Ó¦ÓÃ
ÈçÏÂͨ¹ýÒ»¸ö×î¼òµ¥µÄСdemo£¬ÑÝʾÈçºÎ½øÐÐjni¿ª·¢¡£
¶þ¡¢demoÑÝʾ
1. н¨JAVAÎļþ
н¨Ò»¸öjavaÀ࣬ÈçÏ£º
view plaincopy to clipboardprint?
package chb.test.jni;
public class HelloJni {
public native void sayHello();
static {
System.loadLibrary("hellojni");
}
public static void main(String[] args) {
new HelloJni().sayHello();
}
}
package chb.test.jni;
public class HelloJni {
public native void sayHello();
static {
System.loadLibrary("hellojni");
}
public static void main(String[] args) {
new HelloJni().sayHello();
}
}
HelloJni.javaÔÚÓ²ÅÌÉϵÄλÖãºD:\workspace\MyWork\src\chb\test\jni\HelloJni.java
2. Éú³ÉclassÎļþ
1) ÀûÓÃjavacÃüÁî½øÐбàÒ룬½øÈëD:\workspace\MyWork\src\chb\test\jniĿ¼£¬ÀûÓÃ
view plaincopy to clipboardprint?
javac HelloJni.java
javac HelloJni.java
2) ÀûÓÃIDE£¬ÀýÈçÎÒÀûÓÃeclipse¿ª·¢£¬×Ô¶¯±àÒ룬±àÒëºóµÄÎļþλÓÚ£ºD
Ïà¹ØÎĵµ£º
Èí¼þ¼¼ÊõµÄѸÃÍ·¢Õ¹ÈÃJava
ÊÀ½çµÄWeb ¿ò¼Ü
ÁìÓò
·çÆðÔÆÓ¿£¬¸÷Öּܹ¹²ã³ö²»Çµ«ÄãÄÇ?
¡¡¡¡»Øµ½ÁùÄêÇ°µÄ½ñÌì̸ÂÛÕâ¸ö»°Ì⣬ÎÒ»áÍÑ¿Ú¶ø³ö£ºStruts. ÄÇÊÇÒ»¸ö¶ÔStruts¼¸ºõ³ç°ÝµÄʱ´ú£¬¼¸ºõûÈ˶ÔÆäÖÊÒÉ¡£ÄÇʱJava
ÊÀ½çµÄWeb
frameworkÊÀ½çÈç´Ë"µ¥´¿"£¬µ¥´¿µÃÈç´Ë¿ìÀÖ¡£
¡¡¡¡¾µä£¬¿°³Æ¾µä¡£ÌÈÈôÎÒÔÚ´ËÊ ......
ÔÚjavaÖУ¬¼ÙÉèÄãÓÐÒ»¸öuser ¶ÔÏóµÄlist£¬´Ëuser¶ÔÏó·â×°ÁËÓû§µÄid, first name, last name and age. È»ºóÄãÏëµ÷ÓÃÒ»¸öweb service(eg. UserService.deleteUsersByIds(List<Integer> userIds) ȥɾ³ýÊý¾Ý¿âÖÐÖ¸¶¨µÄÕâЩuser¡£ ÌýÆðÀ´Ëƺõ²»Ì«À§ÄÑ£¬²»ÊÇô? ÄãËùÐèÒªÖ»Êǽ« List<User> ת»¯³ÉList&l ......
תÁíÒ»¸öÂÛ̳µÄÌû×Ó£º
ѸÀ×ÃæÊÔ»ØÀ´£¬ÓÃÁËÕûÕûÒ»ÏÂÎ磨²»ÖªµÀÔõô˵ÁË£¬ÆäÖеȴýʱ¼ä¶¼¿ì2СʱÁË£©£¬×Ô¼º¸Ð¾õ±ÊÊÔºÍÉÏ»ú»¹¿ÉÒÔ£¬µ«¼¼ÊõÃæ̸ÕâÒ»¹Ø´ðµÃ²»Ì«ºÃ£¬ÏÖÔÚÔٴθоõ»¥ÁªÍø¹«Ë¾ÓëÒ»°ãÈí¼þ¹«Ë¾µÄÇø±ðÁË£¬ÆäÖÐÒ»µã¾ÍÊÇ»¥ÁªÍøÓ¦ÓÃÔÚÐÔÄÜÉÏÒªÇóºÜ¸ß£¬Ì¸ÁËÒ»¸öСʱ´ó²¿·ÖÌâÄ¿¸Ð¾õ¶¼ÔÚ̸ÂÛÐÔÄÜÎÊÌ⣬×Ô¼ºÔÚ·½ÃæÒ»Ö±ÊÇÈõÏî ......
ҪʹÓÃdom4j¶ÁдXMLÎĵµ,ÐèÒªÏÈÏÂÔØdom4j°ü,dom4j¹Ù·½ÍøÕ¾ÔÚ http://www.dom4j.org/
Ä¿Ç°×îÐÂdom4j°üÏÂÔصØÖ·: http://nchc.dl.sourceforge.net/sourceforge/dom4j/dom4j-1.6.1.zip
½â¿ªºóÓÐÁ½¸ö°ü,½ö²Ù×÷XMLÎĵµµÄ»°°Ñdom4j-1.6.1.jar¼ÓÈ빤³Ì¾Í¿ÉÒÔÁË,Èç¹ûÐèҪʹÓÃXPathµÄ»°»¹ÐèÒª¼ÓÈë°üjaxen-1.1-beta-7.jar.
ÒÔÏÂ ......
µÚÒ»ÕÂ ÒýÑÔ
(By wind5shy£ºhttp://blog.csdn.net/wind5shy)
µÚ¶þÕ ´´½¨ºÍÏú»Ù¶ÔÏó
(By wind5shy£ºhttp://blog.csdn.net/wind5shy)
µÚ1Ìõ£º¿¼ÂÇÓþ²Ì¬¹¤³§·½·¨´úÌæ¹¹Ô캯Êý
ºÃ´¦£º
¾²Ì¬¹¤³§·½·¨ÓÐÃû×Ö£¬±í´ï¸üÇå³þ¡£
²»Ðè´´½¨ÐµĶÔÏó¡£
¿ÉÒÔ·µ»ØÔ·µ»ØÀàÐ͵Ä×ÓÀàÐͶÔÏó¡£Ó¦Óãº1.·µ»ØÀàÐͶ¨ÒåΪ½ ......