Java¼¸¸ö¹ýÂËÆ÷ѧϰ¼¼ÇÉ
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 Èç¹ûÓû§Î´µÇ¼£¬ÔòÖØ¶¨Ïòµ½Ö¸¶¨µÄÒ³Ãæ£¬URL²»°üÀ¨ ContextPath
¡¡¡¡* notCheckURLList ²»×ö¼ì²éµÄURLÁÐ±í£¬ÒԷֺŷֿª£¬²¢ÇÒ URL Öв»°üÀ¨ ContextPath
¡¡¡¡*/
¡¡¡¡public class CheckLoginFilter
¡¡¡¡implements Filter
¡¡¡¡{
¡¡¡¡protected FilterConfig filterConfig = null;
¡¡¡¡private String redirectURL = null;
¡¡¡¡private List notCheckURLList = new
Ïà¹ØÎĵµ£º
Ê×ÏÈjava½Ó¿ÚºÍ³éÏóÀà´ú±íµÄ¾ÍÊdzéÏóÀàÐÍ£¬¾ÍÊÇÎÒÃÇÐèÒªÌá³ö³éÏó²ãµÄ¾ßÌåʵÏÖ£¬Èç¹ûÒªÌá¸ß³ÌÐòµÄ¸´ÓÃÂÊ£¬¿Éά»¤ÐÔ£¬¿ÉÀ©Õ¹ÐÔ£¬¾Í±ØÐëÃæÏò½Ó¿ÚºÍ³éÏó±à³Ì£¬ÕýȷʹÓÃËûÃÇ¡£ £¨1£©³éÏóÀà¿ÉÒÔÌṩʵÏÖ·½·¨£¬½Ó¿Ú²»ÄÜ
ÕâÊdzéÏóÀàµÄΨһÓŵ㣬¶øÇҷdz£ÓÐÓã¬ÀýÈ磬Ä㶨ÒåÒ»¸ö½Ó¿Ú£¬×ÓÀ಻ÐèÒªËûµÄËùÓз½·¨£¬¿ÉÊÇÄãû°ì·¨²»È¥ ......
package test;
/**
*
* @author openpk
*/
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Semaphore;
public class Main {
public static void main(String[] args) {
// Ï̳߳Ø
ExecutorService exec = Executors ......
=====suppose such a method:
public static void openFile(String fileName, PrintWriter stream) throws FileNotFoundException
{
stream = new PrintWriter(fileName);
}
=====then we want to use it this way:
PrintWriter toFile = null;
try
{
openFile("data.txt", t ......
ÔÚJAVAÎļþÖлñÈ¡¸ÃÏîÄ¿µÄÏà¶Ô·¾¶
1.»ù±¾¸ÅÄîµÄÀí½â
¡¡¡¡¾ø¶Ô·¾¶£º¾ø¶Ô·¾¶¾ÍÊÇÄãµÄÖ÷Ò³ÉϵÄÎļþ»òĿ¼ÔÚÓ²ÅÌÉÏÕæÕýµÄ·¾¶£¬(URLºÍÎïÀí·¾¶)ÀýÈ磺
C:\xyz\test.txt ´ú±íÁËtest.txtÎļþµÄ¾ø¶Ô·¾¶¡£http://www.sun.com/index.htmÒ²´ú±íÁËÒ»¸ö
URL¾ø¶Ô·¾¶¡£
¡¡¡¡Ïà¶Ô·¾¶£ºÏà¶ÔÓëij¸ö»ù׼Ŀ¼µÄ·¾¶¡£°üº¬WebµÄ ......
JavaÖжÑÕ»µÄ¸ÅÄȻÊÇÂß¼Éϵģ¬ÔÚÍêÈ«·ûºÏJava¹æ·¶µÄJava´¦ÀíÆ÷ÃæÊÀ֮ǰ£¬ËùÓÐJavaÐéÄâ»úÌṩµÄÄÚÈݶ¼ÊÇÓÉÈí¼þÄ£Äâ³öÀ´µÄ¡£
ʲô½Ð¶Ñ£¿ÄãÓÃÊ®¼¸¸öÂ齫ůÊúÖ±µþ³ÉÒ»ÞûÕâ½Ð¶Ñ£¬Äã¿ÉÒÔ´ÓÉÏÃæ¡¢ÏÂÃæ¡¢ÖмäÈÎÒâ³é³öÒ»ÕÅÅÆ£¬Ò²¿ÉÒÔÈÎÒâ²åÈëÒ»ÕÅ¡£
ʲô½ÐÕ»£¿AK-47µÄµ¯Ï»¾ÍÊÇÒ»¸öÕ»£¬ÔÚÉÏÃæµÄ×Óµ¯Ã»±»È¡³ö֮ǰ£¬ÄãÎÞ·¨È¡³öÏÂà ......