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

Java»ñÈ¡ÇëÇó¿Í»§¶ËµÄÕæʵIPµØÖ·

ת×Ô http://blog.csdn.net/foamflower/archive/2009/10/29/4744862.aspx
ÏñÒƶ¯Íø¹ØÒ»Ñù£¬iisforwardÕâ¸öISAPI¹ýÂËÆ÷Ò²»á¶Ôrequest¶ÔÏó½øÐÐÔÙ°ü×°£¬¸½¼ÓһЩWLSÒªÓõÄÍ·ÐÅÏ¢¡£ÕâÖÖÇé¿öÏ£¬Ö±½ÓÓÃrequest.getRemoteAddr()
ÊÇÎÞ·¨È¡µ½ÕæÕýµÄ¿Í»§IPµÄ¡£
ʵ¼ÊµÄiisforward¸½¼ÓÍ·ÈçÏ£º
WL-Proxy-Client-IP=211.161.1.239
Proxy-Client-IP=211.161.1.239
X-Forwarded-For=211.161.1.239
WL-Proxy-Client-Keysize=
WL-Proxy-Client-Secretkeysize=
X-WebLogic-Request-ClusterInfo=true
X-WebLogic-KeepAliveSecs=30
X-WebLogic-Force-JVMID=-327089098
WL-Proxy-SSL=false
×ÛÉÏ£¬ÕýÈ·×÷·¨ÈçÏ£º
private String getIpAddr() {
     String ipAddress = null;
     //ipAddress = this.getRequest().getRemoteAddr();
     ipAddress = this.getRequest().getHeader("x-forwarded-for");
     if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
      ipAddress = this.getRequest().getHeader("Proxy-Client-IP");
     }
     if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
         ipAddress = this.getRequest().getHeader("WL-Proxy-Client-IP");
     }
     if(ipAddress == null || ipAddress.length() == 0 || "unknown".equalsIgnoreCase(ipAddress)) {
      ipAddress = this.getRequest().getRemoteAddr();
      if(ipAddress.equals("127.0.0.1")){
       //¸ù¾ÝÍø¿¨È¡±¾»úÅäÖõÄIP
       InetAddress inet=null;
    try {
     inet = InetAddress.getLocalHost();
    } catch (UnknownHostException e) {
     e.printStackTrace();
    }
&n


Ïà¹ØÎĵµ£º

javaÈëÃÅ

 Javaѧϰ´ÓÈëÃŵ½¾«Í¨ 
Ò»¡¢ JDK (Java Development Kit) 
JDKÊÇÕû¸öJavaµÄºËÐÄ£¬°üÀ¨ÁËJavaÔËÐл·¾³£¨Java Runtime Envirnment£©£¬Ò»¶ÑJava¹¤¾ßºÍJava»ù´¡µÄÀà¿â(rt.jar)¡£²»ÂÛʲôJavaÓ¦Ó÷þÎñÆ÷ʵÖʶ¼ÊÇÄÚÖÃÁËij¸ö°æ±¾µÄJDK¡£Òò´ËÕÆÎÕJDKÊÇѧºÃJavaµÄµÚÒ»²½¡£×îÖ÷Á÷µÄJ ......

java JNI ³¢ÊÔ

 ¡¡¡¡Ê×ÏÈÒýÓÃһƪÎÄÕ£¬½éÉÜÒ»¸ö¼òµ¥µÄJNIµÄµ÷ÓõĹý³Ì¡£¡¡¡¡JAVAÒÔÆä¿çƽ̨µÄÌØÐÔÉîÊÜÈËÃÇϲ°®£¬¶øÓÖÕýÓÉÓÚËüµÄ¿çƽ̨µÄÄ¿µÄ£¬Ê¹µÃËüºÍ±¾µØ»úÆ÷µÄ¸÷ÖÖÄÚ²¿ÁªÏµ±äµÃºÜÉÙ£¬Ô¼ÊøÁËËüµÄ¹¦ÄÜ¡£½â¾öJAVA¶Ô±¾µØ²Ù×÷µÄÒ»ÖÖ·½·¨¾ÍÊÇJNI¡£¡¡¡¡JAVAͨ¹ýJNIµ÷Óñ¾µØ·½·¨£¬¶ø±¾µØ·½·¨ÊÇÒÔ¿âÎļþµÄÐÎʽ´æ·ÅµÄ£¨ÔÚWINDOWSƽ̨ÉÏÊÇDL ......

Java Reflection

 
·´ÉäÊÇJavaÓïÑÔÖкÜÖØÒªµÄÒ»¸ö×é³É²¿·Ö£¬ËùÒԾʹ˻°ÌâÌÖÂÛµÄ×ÊÔ´¿ÉνÊýÖ®²»¾¡£¬ÈÕ³£¿ª·¢Ò²»á¾­³£Ê¹Óõ½¹ØÓÚ·´ÉäµÄReflection
API¡£Java5.0
Tiger³öÏÖÒԺ󣬸ü¶Ô·´ÉäAPIÓÐÁËеÄÀ©Õ¹£¬¾¡¹ÜÌÖÂ۵Ļ°ÌâºÜ¶à£¬²»¹ýÎÒ»¹ÊǾõµÃ²»¹»È«Ã棬ÓÈÆäÊǶԷºÐÍÕâÒ»¿é£¬ËùÒÔ¾ÍÎÒËùÖª£¬ÔÙ»¨Á¦Æø×ܽáÒ»·¬
Ê×ÏÈ·´ÉäµÄÈë¿ÚÊÇ´ÓClass¿ ......

javaʵÏÖzipÓëunzip

 jdkÌṩÁËZipÏà¹ØµÄÀà·½±ãµÄʵÏÖѹËõºÍ½âѹËõ¡£Ê¹Ó÷½·¨ºÜ¼òµ¥¡£Ï±߷ֱðÊÇѹËõºÍ½âѹËõµÄ¼òµ¥ÊÂÀý
1¡¢Ñ¹ËõµÄ
import java.io.BufferedInputStream;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.util.zip.ZipE ......

JVMÏê½âÖ®JavaÀ¬»ø»ØÊÕ»úÖÆÏê½âºÍµ÷ÓÅ £¨3£©

 5.ÈçºÎ´ÓJVMÖлñÈ¡ÐÅÏ¢À´½øÐе÷Õû
¡¡¡¡-verbose.gc¿ª¹Ø¿ÉÏÔʾgcµÄ²Ù×÷ÄÚÈÝ¡£´ò¿ªËü£¬¿ÉÒÔÏÔʾ×îæºÍ×î¿ÕÏÐÊÕ¼¯ÐÐΪ·¢ÉúµÄʱ¼ä¡¢ÊÕ¼¯Ç°ºóµÄÄÚ´æ´óС¡¢ÊÕ¼¯ÐèÒªµÄʱ¼äµÈ¡£´ò¿ª- xx:+ printgcdetails¿ª¹Ø£¬¿ÉÒÔÏêϸÁ˽âgcÖеı仯¡£´ò¿ª-XX: + PrintGCTimeStamps¿ª¹Ø£¬¿ÉÒÔÁ˽âÕâЩÀ¬»øÊÕ¼¯·¢ÉúµÄʱ¼ä£¬×ÔjvmÆô¶¯ÒÔºóÒÔ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ