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

ËĸöÓÐÓõÄJava¹ýÂËÆ÷ Filter¹ýÂËÆ÷µÄʹÓÃ

Ò»¡¢Ê¹ä¯ÀÀÆ÷²»»º´æÒ³ÃæµÄ¹ýÂËÆ÷     
import javax.servlet.*;    
import javax.servlet.http.HttpServletResponse;    
import java.io.IOException;    
   
/**   
* ÓÃÓÚµÄʹ Browser ²»»º´æÒ³ÃæµÄ¹ýÂËÆ÷   
*/   
public class ForceNoCacheFilter implements Filter {    
   
public void doFilter(ServletRequest request, ServletResponse response, FilterChain filterChain) throws IOException, ServletException    
{    
    ((HttpServletResponse) response).setHeader("Cache-Control","no-cache");    
    ((HttpServletResponse) response).setHeader("Pragma","no-cache");    
    ((HttpServletResponse) response).setDateHeader ("Expires", -1);    
    filterChain.doFilter(request, response);    
}    
   
public void destroy()    
{    
}    
   
      public void init(FilterConfig filterConfig) throws ServletException    
{    
}    
}    
   
¶þ¡¢¼ì²âÓû§ÊÇ·ñµÇ½µÄ¹ýÂËÆ÷    
   
import javax.servlet.*;    
import javax.servlet.http.HttpServletRequest;    
import javax.servlet.http.HttpServletResponse;    
import javax.servlet.http.HttpSession;    
import java.util.List;    
import java.util.ArrayList;    
import java.util.StringTokenizer;    
import java.io.IOException;    
 


Ïà¹ØÎĵµ£º

ÎÒµÄJava×ܽá

1£® OverloadºÍOverrideµÄÇø±ð¡£OverloadedµÄ·½·¨ÊÇ·ñ¿ÉÒԸı䷵»ØÖµµÄÀàÐÍ
  ´ð£º·½·¨µÄÖØÐ´OverridingºÍÖØÔØOverloadingÊÇJava¶à̬ÐԵIJ»Í¬±íÏÖ¡£ÖØÐ´Overriding    ÊǸ¸ÀàÓë×ÓÀàÖ®¼ä¶à̬ÐÔµÄÒ»ÖÖ±íÏÖ£¬ÖØÔØOverloadingÊÇÒ»¸öÀàÖжà̬ÐÔµÄÒ»ÖÖ±íÏÖ¡£ Èç¹ûÔÚ×ÓÀàÖж¨Òåij·½·¨ÓëÆä¸¸ÀàÓÐÏàͬµÄÃû³ÆºÍ² ......

java È¡µÃ ¿Í»§¶ËIP

ÔÚJSPÀ»ñÈ¡¿Í»§¶ËµÄIPµØÖ·µÄ·½·¨ÊÇ£ºrequest.getRemoteAddr£¨£©£¬ÕâÖÖ·½·¨Ôڴ󲿷ÖÇé¿ö϶¼ÊÇÓÐЧµÄ¡£µ«ÊÇÔÚͨ¹ýÁËApache£¬SquidµÈ·´Ïò´úÀíÈí¼þ¾Í²»ÄÜ»ñÈ¡µ½¿Í»§¶ËµÄÕæÊµIPµØÖ·ÁË¡£
    Èç¹ûʹÓÃÁË·´Ïò´úÀíÈí¼þ£¬½«http://192.168.1.110£º2046/ µÄURL·´Ïò´úÀíΪ
http://www.bt285.cn /
µÄURLʱ£¬ÓÃreques ......

java ·´Éä ¸´ÖƶÔÏó

public static Object getCloneObject(Object bean) {
Object cloneBean = null;
try {
ByteArrayOutputStream byout = new ByteArrayOutputStream();
ObjectOutputStream obj = new ObjectOutputStream(byout);
obj.writeObject(bean);
ByteArrayInputStream byin = new ByteArrayInputStream(byou ......

java ·ºÐÍ

Ò»¡¢
ʹÓ÷ºÐ͵ĺô¦ÔÚÓÚ£¬ËüÔÚ±àÒëµÄʱºò½øÐÐÀàÐͰ²È«¼ì²é£¬²¢ÇÒÔÚÔËÐÐʱËùÓеÄת»»¶¼ÊÇÇ¿ÖÆµÄ£¬ÒþʽµÄ£¬´ó´óÌá¸ßÁË´úÂëµÄÖØÓÃÂÊ¡£
Çë¿´ÏÂÃæÕâ¸öÀý×Ó
public class Gen<T> {
 private T ob; // ¶¨Òå·ºÐͳÉÔ±±äÁ¿
 public Gen(T ob) {
  this.ob = ob;
 }
 public T getOb() { ......

Java NIO APIÏê½â

Java NIO APIÏê½â

ÔÚJDK 1.4ÒÔǰ£¬JavaµÄIO²Ù×÷¼¯ÖÐÔÚjava.ioÕâ¸ö°üÖУ¬ÊÇ»ùÓÚÁ÷µÄͬ²½£¨blocking£©API¡£¶ÔÓÚ´ó¶àÊýÓ¦ÓÃÀ´Ëµ£¬ÕâÑùµÄAPIʹÓúܷ½±ã£¬È»¶ø£¬Ò»Ð©¶ÔÐÔÄÜÒªÇó½Ï¸ßµÄÓ¦Óã¬ÓÈÆäÊÇ·þÎñ¶ËÓ¦Óã¬ÍùÍùÐèÒªÒ»¸ö¸üΪÓÐЧµÄ·½Ê½À´´¦ÀíIO¡£´ÓJDK 1.4Æð£¬NIO API×÷Ϊһ¸ö»ùÓÚ»º³åÇø£¬²¢ÄÜÌṩÒì²½(non-blocking)IO ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ