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

java filterÓ÷¨´óÈ«

¹Ø¼ü×Ö: filter
    ¹ýÂËÆ÷FilterÒ²¾ßÓÐÉúÃüÖÜÆÚ£ºinit()->doFilter()->destroy()£¬Óɲ¿ÊðÎļþÖеÄfilterÔªËØÇý¶¯¡£ÔÚservlet2.4ÖУ¬¹ýÂËÆ÷ͬÑù¿ÉÒÔÓÃÓÚÇëÇó·ÖÅÉÆ÷£¬µ«ÐëÔÚweb.xmlÖÐÉùÃ÷£¬<dispatcher>INCLUDE»òFORWARD»òREQUEST»òERROR</dispatcher>¸ÃÔªËØλÓÚfilter-mappingÖС£
Ò»¡¢ÅúÁ¿ÉèÖÃÇëÇó±àÂë
Java´úÂë
public class EncodingFilter implements Filter {   
  
    private String encoding = null;   
  
    public void destroy() {   
         encoding = null;   
     }   
  
    public void doFilter(ServletRequest request, ServletResponse response,   
             FilterChain chain) throws IOException, ServletException {   
         String encoding = getEncoding();   
        if (encoding == null){   
             encoding = "gb2312";   
         }   
         request.setCharacterEncoding(encoding);// ÔÚÇëÇóÀïÉèÖÃÉÏÖ¸¶¨µÄ±àÂë   
         chain.doFilter(request, response);   
     }   
  
    public void init(FilterConfig filterConfig) throws ServletException {   
        this.encoding = filterConfig.getInitParameter("encoding");   
     }   
  
    private String getEncoding() {   
       &nbs


Ïà¹ØÎĵµ£º

javaÈëÃÅ

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

¡¶ÓûΪJava¼¼Êõ´óÅ£ËùÐèµÄ25¸öѧϰҪµã¡·¶Áºó¸Ð

½ñÈÕ¶Áµ½csdnµÄÐÂÎÅ¡¶ÓûΪJava¼¼Êõ´óÅ£ËùÐèµÄ25¸öѧϰҪµã¡·£¬Á˽âÒª×öÒ»¸öJava¼¼Êõ´óÅ£¿É²»ÊÇÒ»°ãÒ»°ãµÄ£¬ÌØÊÕ¼ÔÚ´Ë£ºÒÔ±Þ²ß×Ô¼º²»¶Ïѧϰ£º
1. ÄãÐèÒª¾«Í¨ÃæÏò¶ÔÏó·ÖÎöÓëÉè¼Æ(OOA/OOD)¡¢É漰ģʽ(GOF£¬J2EEDP)ÒÔ¼°×ÛºÏģʽ¡£ÄãÓ¦¸ÃÁ˽âUML£¬ÓÈÆäÊÇclass¡¢object¡¢interactionÒÔ¼°statediagrams¡£
2. ÄãÐèҪѧϰJavaÓïÑÔ ......

Effective Java¶ÁÊé±Ê¼Ç

package chape8;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* µÚ°ËÕ ͨÓóÌÐòÉè¼Æ
* µÚ45Ìõ£º ½«¾Ö²¿±äÁ¿µÄ×÷ÓÃÓò¼õСµ½×îС
*   ½«¾Ö²¿±äÁ¿µÄ×÷ÓÃÓò×îС»¯¡£¿ÉÒÔÔöÇ¿´úÂëµÄ¿É¶ÁºÍ¿Éά»¤ÐÔ£¬²¢½µµÍ³ö´íµÄ¿ÉÄÜÐÔ
*   Ҫʹ×÷ÓÃÓò×îС£¬×îÓÐÁ ......

java stringÀàÏê½â

Java×Ö·û´®Àà(java.lang.String)ÊÇJavaÖÐʹÓÃ×î¶àµÄÀ࣬ҲÊÇ×îΪÌØÊâµÄÒ»¸öÀ࣬ºÜ¶àʱºò£¬ÎÒÃǶÔËü¼ÈÊìϤÓÖÄ°Éú¡£
 
Ò»¡¢´Ó¸ù±¾ÉÏÈÏʶjava.lang.StringÀàºÍString³Ø
 
Ê×ÏÈ£¬ÎÒ½¨ÒéÏÈ¿´¿´StringÀàµÄÔ´ÂëʵÏÖ£¬ÕâÊÇ´Ó±¾ÖÊÉÏÈÏʶStringÀàµÄ¸ù±¾³ö·¢µã¡£´ÓÖпÉÒÔ¿´µ½£º
1¡¢StringÀàÊÇfinalµÄ£¬²»¿É±»¼Ì³Ð¡£publ ......

Java¶àÏ̳߳ÌÐòÉè¼ÆÏêϸ½âÎö

 ¡¡Ò»¡¢Àí½â¶àÏß³Ì
¡¡¡¡¶àÏß³ÌÊÇÕâÑùÒ»ÖÖ»úÖÆ£¬ËüÔÊÐíÔÚ³ÌÐòÖв¢·¢Ö´Ðжà¸öÖ¸ÁîÁ÷£¬Ã¿¸öÖ¸ÁîÁ÷¶¼³ÆΪһ¸öỊ̈߳¬±Ë´Ë¼ä»¥Ïà¶ÀÁ¢¡£
¡¡¡¡Ïß³ÌÓÖ³ÆΪÇáÁ¿¼¶½ø³Ì£¬ËüºÍ½ø³ÌÒ»ÑùÓµÓжÀÁ¢µÄÖ´ÐпØÖÆ£¬ÓɲÙ×÷ϵͳ¸ºÔðµ÷¶È£¬Çø±ðÔÚÓÚÏß³ÌûÓжÀÁ¢µÄ´æ´¢¿Õ¼ä£¬¶øÊǺÍËùÊô½ø³ÌÖеÄÆäËüÏ̹߳²ÏíÒ»¸ö´æ´¢¿Õ¼ä£¬ÕâʹµÃÏ̼߳äµÄͨÐÅ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ