Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

java»ñµÃ´úÀíÕæʵIP


ÏîÄ¿ÖÐÐèÒªºÍµÚÈý·½Æ½Ì¨½Ó¿Ú£¬¼ÓÁËÀ´Ô´IP¼øȨ¹¦ÄÜ£¬²âÊÔʱ·¢ÏÖûÓÐÎÊÌ⣬µ«ÊDz¿ÊðÒÔºó·¢ÏÖ´æÔÚÎÊÌ⣬һֱ¼øȨ²»Í¨¹ý£¬Ò»ÈºÈËץϹ¡£
ÎÒÕÒµ½ÄÇ¿éµÄ´úÂ룬¸úÁËÒ»±éÁ÷³Ì·¢ÏÖÂß¼­Ã»ÓÐɶÎÊÌ⣬µ«ÊÇ×îÖյĽá¹ûÈ´»¹ÊǼøȨ²»Í¨¹ý£¬ÊµÔÚÓÐЩ¹îÒì¡£Æä»ù±¾Âß¼­ÎªÏÈÈ¡µÃÅäÖõÄIPÁÐ±í£¬È»ºóͨ¹ýrequest.getRemoteAddr()È¡µÃ¿Í»§¶ËµÄIPµØÖ·£¬×ö¼øȨºÍУÑ飬Âß¼­Ã»ÎÊÌ⣬ÄÇô¿Ï¶¨ÊÇrequest.getRemoteAddr()³öÁËÎÊÌ⣬googleÏ£¬·¢ÏÖÓÐÈËÓöµ½ÀàËƵÄÎÊÌâ¡£
×îÖÕ¶¨Î»Îªrequest.getRemoteAddr()ÕâÖÖ·½·¨Ôڴ󲿷ÖÇé¿ö϶¼ÊÇÓÐЧµÄ¡£µ«ÊÇÔÚͨ¹ýÁËApache,SquidµÈ·´Ïò´úÀíÈí¼þ¾Í²»ÄÜ»ñÈ¡µ½¿Í»§¶ËµÄÕæʵIPµØÖ·ÁË¡£
Èç¹ûʹÓÃÁË·´Ïò´úÀíÈí¼þ£¬½«http://192.168.1.110:2046/ µÄURL·´Ïò´úÀíΪhttp://www.xxx.com/ µÄURLʱ£¬ÓÃrequest.getRemoteAddr()·½·¨»ñÈ¡µÄIPµØÖ·ÊÇ£º127.0.0.1¡¡»ò¡¡192.168.1.110£¬¶ø²¢²»ÊÇ¿Í»§¶ËµÄÕæʵ£É£Ð¡£
¾­¹ý´úÀíÒÔºó£¬ÓÉÓÚÔÚ¿Í»§¶ËºÍ·þÎñÖ®¼äÔö¼ÓÁËÖмä²ã£¬Òò´Ë·þÎñÆ÷ÎÞ·¨Ö±½ÓÄõ½¿Í»§¶ËµÄIP£¬·þÎñÆ÷¶ËÓ¦ÓÃÒ²ÎÞ·¨Ö±½Óͨ¹ýת·¢ÇëÇóµÄµØÖ··µ»Ø¸ø¿Í»§¶Ë¡£µ«ÊÇÔÚת·¢ÇëÇóµÄHTTPÍ·ÐÅÏ¢ÖУ¬Ôö¼ÓÁËX£­FORWARDED£­FORÐÅÏ¢ÓÃÒÔ¸ú×ÙÔ­ÓеĿͻ§¶ËIPµØÖ·ºÍÔ­À´¿Í»§¶ËÇëÇóµÄ·þÎñÆ÷µØÖ·¡£
Ô­À´Èç´Ë£¬ÎÒÃǵÄÏîÄ¿ÖÐÕýºÃÊÇÓÐÇ°ÖÃapache£¬½«Ò»Ð©ÇëÇóת·¢¸øºó¶ËµÄweblogic£¬¿´À´¾ÍÊÇÕâÑùµ¼ÖµĿ©¡£
¸ø³öÒ»·Ý»¹Ëã¿¿Æ׵ĴúÂ룬ÈçÏ£º
Java´úÂë
public String getIpAddr(HttpServletRequest request) {      
      String ip = request.getHeader("x-forwarded-for");      
      if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {      
         ip = request.getHeader("Proxy-Client-IP");      
     }      
      if(ip == null || ip.length() == 0 || "unknown".equalsIgnoreCase(ip)) {      
       &nb


Ïà¹ØÎĵµ£º

java³õѧÕß±ØÐëÕÆÎյĻù±¾¸ÅÄî


java³õѧÕß±ØÐëÕÆÎյĻù±¾¸ÅÄî
java³õѧÕß±ØÐëÕÆÎյĻù±¾¸ÅÄî
1.³éÏó£º
¡¡³éÏó¾ÍÊǺöÂÔÒ»¸öÖ÷ÌâÖÐÓ뵱ǰĿ±êÎ޹صÄÄÇЩ·½Ã棬ÒÔ±ã¸ü³ä·ÖµØ×¢ÒâÓ뵱ǰĿ±êÓйصķ½Ãæ¡£³éÏó²¢²»´òËãÁ˽âÈ«²¿ÎÊÌ⣬¶øÖ»ÊÇÑ¡ÔñÆäÖеÄÒ»²¿·Ö£¬ÔÝʱ²»Óò¿·Öϸ½Ú¡£³éÏó°üÀ¨Á½¸ö·½Ã棬һÊǹý³Ì³éÏ󣬶þÊÇÊý¾Ý³éÏó¡£
2.¼Ì³Ð£º
¡¡¼Ì³ÐÊÇÒ»ÖÖÁª ......

JavaÃÕÌâ6——¿âÃÕÌâ


 
ÃÕÌâ56£º´óÎÊÌâ | ÃÕÌâ57£ºÃû×ÖÀïÓÐʲô£¿ | ÃÕÌâ58£º²úÉúËüµÄÉ¢ÁÐÂë | ÃÕÌâ59£ºÊ²Ã´ÊDz | ÃÕÌâ60£ºÒ»Ðеķ½·¨ | ÃÕÌâ61£ºÈÕÆÚÓÎÏ· | ÃÕÌâ62£ºÃû×ÖÓÎÏ· | 
ÃÕÌâ63£º¸ü¶àͬÑùµÄÎÊÌâ | ÃÕÌâ64£º°´ÓàÊý±à×é | ÃÕÌâ6 ......

ÃüÃû·½·¨(JAVA)


ÃüÃû·½·¨(JAVA)
ÃüÃû·½·¨£º
1£¬ÂæÍÕ(Camel)ÃüÃû·¨£ºµÚÒ»¸ö×ÖĸСд£¬ËæºóµÄÿ¸öµ¥´ÊµÄµÚÒ»¸ö×Öĸ´óд¡£È磺studentName
2£¬ÅÁ˹¿¨(Pascal)ÃüÃû·¨£ºÃ¿Ò»¸öµ¥´ÊµÄµÚÒ»¸ö×Öĸ¶¼´óд¡£È磺StudentName
3£¬ÐÙÑÀÀûÃüÃû·¨£º¼Óǰ׺¡£ÈçbtnName,txtName.
1,ÃüÃû¿Õ¼ä
ÒÔPascalÃüÃû·¨.
2,Àà
ÒÔPascalÃüÃû·½·¨£¬È·±£ÀàµÄÃû³Æ ......

ת£ºÕÅÆæ £­ Ò»¸öJava³ÌÐòÔ±Ó¦¸ÃÕÆÎÕµÄ10Ïî¼¼ÄÜ


1¡¢Óï·¨
£º±ØÐë±È½ÏÊìϤ£¬ÔÚд´úÂëµÄʱºòIDEµÄ±à¼­Æ÷¶ÔijһÐб¨´íÓ¦¸ÃÄܹ»¸ù¾Ý±¨´íÐÅÏ¢ÖªµÀÊÇʲôÑùµÄÓï·¨´íÎó²¢ÇÒÖªµÀÈκÎÐÞÕý¡£
2¡¢ÃüÁî
£º±ØÐëÊìϤJDK´øµÄһЩ³£ÓÃÃüÁî¼°Æä³£ÓÃÑ¡ÏÃüÁîÖÁÉÙÐèÒªÊìϤ£ºappletviewer¡¢
HtmlConverter¡¢jar¡¢
java¡¢javac¡¢javadoc¡¢javap¡¢javaw¡¢native2ascii¡¢serialver£¬Èç¹ûÕ ......

javaÖع¹µÄÀí½â±Ê¼Ç

ÕâÁ½Ìì×ÜÊÇתÌû×ÓÁË£¬²»¹ý¿´¹ýºó£¬ÎÒÊÜÒæ·Ëdz£¡£¡
javaÖÐÖØдºÍÖع¹¶þÕߵĶ¨ÒåºÍÇø±ð£¿
 
Öع¹¿É²»ÊÇ“ÖØÔع¹Ô캯Êý”µÄ¼òд¡£
Èí¼þÖع¹ºÍÖØдѹ¸ù²»ÊÇÒ»¸ö²ã´ÎÉϵĶ«Î÷£¡
Èí¼þÖع¹ÊÇ˵³ÌÐòԱΪÁË¶Ô ÒÑÓгÌÐòÔÚ¾¡Á¿²»¸Ä±ä½Ó¿ÚµÄÇ°ÌáÏ ½øÐÐÈçÏ´¦Àí ¶ø×öµÄ ÖØбàд´úÂëµÄ¹¤×÷
1¡¢È¥³ýbug
2¡¢Ìá¸ßЧ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ