Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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;   
  
/**
* ÓÃÓÚ¼ì²âÓû§ÊÇ·ñµÇ½µÄ¹ýÂËÆ÷£¬Èç¹ûδµÇ¼£¬ÔòÖض¨Ïòµ½Ö¸µÄµÇ¼ҳÃæ
* ÅäÖòÎÊý
* checkSessionKey Ðè¼ì²éµÄÔÚ Session Öб£´æµÄ¹Ø¼ü×Ö
* redirectURL Èç¹ûÓû§Î´µÇ¼£¬ÔòÖض¨Ïòµ½Ö¸¶¨µÄÒ³Ãæ£


Ïà¹ØÎĵµ£º

java¿ì½Ý¼ü

Ctrl+1 ¿ìËÙÐÞ¸´(×î¾­µäµÄ¿ì½Ý¼ü,¾Í²»Óöà˵ÁË)
Ctrl+D: ɾ³ýµ±Ç°ÐÐ
Ctrl+Alt+↓ ¸´ÖƵ±Ç°Ðе½ÏÂÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Ctrl+Alt+↑ ¸´ÖƵ±Ç°Ðе½ÉÏÒ»ÐÐ(¸´ÖÆÔö¼Ó)
Alt+↓ µ±Ç°ÐкÍÏÂÃæÒ»Ðн»»¥Î»ÖÃ(ÌرðʵÓÃ,¿ÉÒÔÊ¡È¥ÏȼôÇÐ,ÔÙÕ³ÌùÁË)
Alt+↑ µ±Ç°ÐкÍÉÏÃæÒ»Ðн»»¥Î»ÖÃ(ͬÉÏ)
Alt+← Ç°Ò»¸ö±à¼­µ ......

JavaÎļþ²Ù×÷´óÈ«£¨Ò»£©

1.´´½¨Îļþ¼Ð
//import java.io.*;
File myFolderPath = new File(%%1);
try {
if (!myFolderPath.exists()) {
   myFolderPath.mkdir();
}
}
catch (Exception e) {
System.out.println("н¨Ä¿Â¼²Ù×÷³ö´í");
e.printStackTra ......

Flex+javaʵÏÖÎļþÉÏ´«

ÓÃÁËÁ½Ììʱ¼äѧϰÁËÏÂFlexºÍjavaÅäºÏʵÏÖÎļþÉÏ´«£¬ÕÒÁ˸öСÀý×Ó¡£Ç°¶Ëµ±È»ÊÇflex£¬ºǫ́ʹÓÃservlet£¬°Ñ´úÂëÌùÉÏÀ´£¬±¸Íü°É£º
FileUpload.java:
import java.io.File;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.List;
import javax.servlet.ServletExc ......

java Filter__ÅäÖúͽ²½â(¶þ)

¹ýÂËÆ÷FilterÒ²¾ßÓÐÉúÃüÖÜÆÚ£ºinit()->doFilter()->destroy()£¬Óɲ¿ÊðÎļþÖеÄfilterÔªËØÇý¶¯¡£ÔÚservlet2.4ÖУ¬¹ýÂËÆ÷ͬÑù¿ÉÒÔÓÃÓÚÇëÇó·ÖÅÉÆ÷£¬µ«ÐëÔÚweb.xmlÖÐÉùÃ÷£¬<dispatcher>INCLUDE»òFORWARD»òREQUEST»òERROR</dispatcher>¸ÃÔªËØλÓÚfilter-mappingÖС£
Ò»¡¢ÅúÁ¿ÉèÖÃÇëÇó±àÂë
Java´úÂë
publ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ