java Ḭ̈߳²È«
Ḭ̈߳²È«
Ö»ÓÐÔÚµ¥Àý²¢·¢µÄÇé¿öϲŻá³öÏÖḬ̈߳²È«ÎÊÌ⣬ÒýÆðÎÊÌâµÄÖ÷ÒªÔÒò¾ÍÔÚÓÚ¶ÔÏóµÄ×ÊÔ´¹²Ïí(ÈçʵÀý±äÁ¿µÈ)£¬²»¹ý¾Ö²¿±äÁ¿ÊÇḬ̈߳²È«µÄ¡£Òò´ËÔÚ³ÌÐòÉè¼ÆµÄʱºò¾¡Á¿²»ÒªÓÃʵÀý±äÁ¿¡£²úÉúÕâÑùÔÒòÔÚÓÚjavaµÄÄÚ´æ·ÖÅä»úÖÆ£¬ÊµÀý±äÁ¿ÊÇ´æ·ÅÔÚ¶ÑÄÚ´æÖеÄËùÓÐÏ̹߳²Ïí£¬¶øÿ¸öÏß³ÌÒ²¶¼ÓÐ×Ô¼ºµÄÏß³ÌÕµ£¬¾Ö²¿±äÁ¿´æ·ÅÔÚÏß³ÌÕµÖУ¬¸÷Ï̶߳ÀÏí¡£
¼òÒªµÄ˵ÔÚ²¢·¢µÄʱºò£¬servletÓëstruts1¶¼Êǵ¥Àý¶àÏßµÄģʽ£¬Ò»µ©ÉùÃ÷µÄÓÐʵÀý±äÁ¿£¬¾Í»áÒýÆðḬ̈߳²È«ÎÊÌâ¡£struts2ÊǶàÀýµ¥Ïßģʽ£¨ÐèÒªÅäÖã©ÎÞËùνḬ̈߳²È«¡£springÖÐserver²ã¶ÔÏóÒ»°ã¶¼ÊÇÎÞ״̬µÄ£¬Òò´ËÔËÓõ¥ÀýÒ಻»á³öÏÖḬ̈߳²È«ÎÊÌ⣬Èç¹û¶ÔÏó´æÔÚ״̬¾ÍÐèÒª¿¼ÂDz¢·¢ÏµÄḬ̈߳²È«ÎÊÌâ¡£
ÏÂÃæ¼òµ¥µÄ½éÉÜÏÂThreadLocal£º
ThreadLocalÊÇʲôÄØ£¿ÆäʵThreadLocal²¢·ÇÊÇÒ»¸öÏ̵߳ı¾µØʵÏÖ°æ±¾£¬Ëü²¢²»ÊÇÒ»¸öThread
£¬¶øÊÇthread local variable£¨Ïֲ߳̾¿±äÁ¿£©¡£Ò²Ðí°ÑËüÃüÃûΪThreadLocalVar¸ü¼ÓºÏÊÊ¡£
Ïֲ߳̾¿±äÁ¿£¨ThreadLocal£©ÆäʵµÄ¹¦Ó÷dz£¼òµ¥£¬¾ÍÊÇΪÿһ¸öʹÓøñäÁ¿µÄÏ̶߳¼Ìṩһ
¸ö±äÁ¿ÖµµÄ¸±±¾£¬ÊÇÿһ¸öÏ̶߳¼¿ÉÒÔ¶ÀÁ¢µØ¸Ä±ä×Ô¼ºµÄ¸±±¾£¬¶ø²»»áºÍÆäËüÏ̵߳ĸ±±¾³åÍ»¡£
´ÓÏ̵߳ĽǶȿ´£¬¾ÍºÃÏñÿһ¸öÏ̶߳¼ÍêÈ«ÓµÓиñäÁ¿¡£
¸öÈ˼òÒªÀí½âΪÏ̵߳ĵ¥Àý¡£ºÍ²¢·¢¶àÏ̲߳¢Ã»ÓÐÖ±½ÓµÄ¹Øϵ£¬¹Ø×¢µÄÁìÓòÒ²ÊDz»Í¬µÄ£¡²»Òª½«ThreadLocalºÍ¶àÏß²¢·¢»ìÏý¡£
ת×Ô£º
http://utopiasky.javaeye.com/blog/576860
Ïà¹ØÎĵµ£º
¶Ôö¾ÙÀàÐÍÓ¡Ïó´ó¶àÀ´×ÔÓÚC
ÓïÑÔ£¬ÔÚ
C
ÓïÑÔÖУ¬Ã¶¾ÙÀàÐÍÊÇÒ»¸ö
HardCode
£¨Ó²±àÂ룩ÀàÐÍ£¬ÆäʹÓüÛÖµ²¢²»´ó¡£Òò´Ë£¬ÔÚ
Java 5
֮ǰ£¬Ã¶¾ÙÊDZ»Å×ÆúµÄ¡£È»¶ø
Java 5
ÒÔºóµÄ·¢ÏÖ°æ±¾¿ªÊ¼¶Ôö¾Ù½øÐÐÖ§³Ö£¬Ã¶¾ÙµÄÒýÈë¸ø
Java
ÊÀ½ç´øÀ´ÁËÕùÒé¡£
±ÊÕ߱ȽÏÔÞͬÒýÈëö¾Ù£¬×÷ΪһÃÅͨÓõľ²Ì¬±à³ÌÓïÑÔ£¬Ó¦¸ÃÊÇ ......
Java ·´ÉäÊÇJavaÓïÑÔµÄÒ»¸öºÜÖØÒªµÄÌØÕ÷£¬ËüʹµÃJava¾ßÌåÁË“¶¯Ì¬ÐÔ”¡£
ÔÚJavaÔËÐÐʱ»·¾³ÖУ¬¶ÔÓÚÈÎÒâÒ»¸öÀ࣬ÄÜ·ñÖªµÀÕâ¸öÀàÓÐÄÄЩÊôÐԺͷ½·¨£¿¶ÔÓÚÈÎÒâÒ»¸ö¶ÔÏó£¬ÄÜ·ñµ÷ÓÃËüµÄÈÎÒâÒ»¸ö·½·¨£¿´ð°¸Êǿ϶¨µÄ¡£ÕâÖÖ¶¯Ì¬»ñÈ¡ÀàµÄÐÅ ......
ÏÖÔÚÊг¡ÉϵÄoa»ù±¾ÉϿɹé½áΪÁ½´óÕóÓª£¬¼´phpÕóÓªºÍjavaÕóÓª¡£µ«¶Ô½Ó´¥oa²»¾ÃµÄÓû§À´Ëµ£¬¿´µ½µÄÍùÍùÖ»ÊÇËüÃǵıíÏֻ࣬ÊÇÃ÷ÏԵļ۸ñ²îÒ죬ȴºÜÄÑ¿´³öËüÃÇÖ®¼äµÄʵ¼Ê²îÒì¡£Æäʵ£¬ PHP + MYSQL ²»ÖµÇ®²»½ö½ö¾ÖÏÞÓÚoaÈí¼þ£¬¶øÊÇÕûÌåÉÏPHP + MYSQL¿ª·¢µÄÈí¼þ¶¼²»Èçjava¿ª·¢µÄÈí¼þֵǮ¡£ÎªÊ²Ã´PHP + MYSQL µÄOAΪʲô²»ÖµÇ®Ä ......
static String string2Unicode(String s) {
try {
StringBuffer out = new StringBuffer("");
byte[] bytes = s.getBytes("unicode");
for (int i = 2; i < bytes.length - 1; i += 2) {
out.append("u");
String str = Integer.toHexString(bytes[i + 1] & 0xff);
f ......