MonoRail 09/12/2(java TO .Net)
MonoRailÊǾµäµÄMVCģʽ,ËùÒÔÆäÖÐÒ²¾ßÓÐÈý¸öÔªËØModel,Controller,View,ÆäÖÐMonoRailÊÇͨ¹ýUrlµØÖ·À´½âÎö
ÏàÓ¦µÄ²Ù×÷µÄ,Èçµ±Äã·ÃÎÊ:/home/index.rail,¶ÔÓ¦»áÖ´ÐÐHomeControllerÀàÖеÄIndex·½·¨,¶øÇÒ¿ÉÒÔ×Ô¶¯°ó¶¨²ÎÊýºÍ
RequestµÄÊý¾Ý,Èç·ÃÎÊ:/home/index.rail?id=1,Äã¿ÉÒÔÔÚHomeControllerÀàÖеÄIndex·½·¨Öж¨ÒåÒ»¸ö²ÎÊý
id,ÔòÔÚIndex(int id)·½·¨Ìå»á×Ô¶¯µÄµÃµ½id=1.
MonoRailµÄ½çÃæͨ³£Ê¹ÓÃNVelocityÄ£°åÓïÑÔÀ´¶¨Òå.
Ïà¹ØÎĵµ£º
Java NIO APIÏê½â
ÔÚJDK
1.4ÒÔÇ°£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄ×èÈû£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½
±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO
API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩ·Ç×èÈû(non-blo ......
Java ÖÐÀàºÍ·½·¨ÐÞÊηû
ÀàµÄÐÞÊÎ
·ÃÎÊÐÞÊηû ÐÞÊηû class ÀàÃû extends ¸¸ÀàÃû³Æ implements ½Ó¿ÚÃû³Æ£¨notes: ·ÃÎÊÐÞÊηû·ûÓëÐÞÊηûµÄλÖÿÉÒÔ»¥»»£©
·ÃÎÊÐÞÊηû
Ãû³Æ
˵Ã÷
±¸×¢
pubic
¿ÉÒÔ±»ËùÓÐÀà·ÃÎÊ(ʹÓÃ)
public Àà±ØÐ붨ÒåÔÚºÍÀàÃûÏàͬµÄͬÃûÎļþÖÐ
package
¿ÉÒÔ±»Í¬Ò»¸ö°üÖеÄÀà·ÃÎÊ(ʹÓÃ)
ĬÈϵķÃÎ ......
//»ñÈ¡Êý¾Ý¿âÊý¾Ý·µ»Ølist
public List queryAll(int fcateId) {
List list = new ArrayList();
String sql = "select * from g_Account where fCateID=? order by fCode";
Connection con = SqlHelp.getConn();//»ñµÃÁ¬½Ó£¬sqlhelp×Ô¼ºÐ´µÄ¹¤¾ßÀà
PreparedStatement pst = null;
ResultSet rs = null;
......
java »ù±¾Êý¾ÝÀàÐÍÖ®¼äµÄת»»
ʵ¼ýÍ·±íʾÎÞÊý¾Ý¶ªÊ§µÄת»»
Ðé¼ýÍ·±íʾÓÐÊý¾Ý¶ªÊ§µÄת»»
ÔÚ½øÐжþÔª¼ÆËãµÄʱºò£¬ÏȽ«Á½¸ö²Ù×÷Êýת»»ÎªÍ¬Ò»ÖÖÀàÐÍ£¬ÔÙ¼ÆËã
¢ÙÈç¹ûÁ½¸öÊýÖÐÓÐÒ»¸öÊÇdoubleÀàÐ͵ģ¬ÄÇôÁíÒ»¸öÒ²½«×ª»»ÎªdoubleÀàÐÍ;
&n ......
Java™ ÓïÑÔ°üº¬Á½ÖÖÄÚÔÚµÄͬ²½»úÖÆ£ºÍ¬²½¿é£¨»ò·½·¨£©ºÍ volatile ±äÁ¿¡£ÕâÁ½ÖÖ»úÖƵÄÌá³ö¶¼ÊÇΪÁËʵÏÖ´úÂëÏ̵߳ݲȫÐÔ¡£ÆäÖÐ Volatile ±äÁ¿µÄͬ²½ÐԽϲµ«ÓÐʱËü¸ü¼òµ¥²¢ÇÒ¿ªÏú¸üµÍ£©£¬¶øÇÒÆäʹÓÃÒ²¸üÈÝÒ׳ö´í¡£ÔÚÕâÆÚµÄ Java ÀíÂÛÓëʵ¼ù
ÖУ¬Brian Goetz ½«½éÉܼ¸ÖÖÕýȷʹÓà volatile ±äÁ¿µÄģʽ£¬²¢Õë¶ÔÆäÊÊÓ ......