서브렛 다중 스레드 테스트
3540 단어 javaEE
/**
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
*/
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
System.out.println(new Date()+": get ------");
System.out.println(" :"+this+";hashCode:"+this.hashCode());
System.out.println(" :"+Thread.currentThread());
}
Sun Jan 14 19:31:28 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-4,5,main]
Sun Jan 14 19:31:29 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-5,5,main]
Sun Jan 14 19:31:29 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-6,5,main]
Sun Jan 14 19:31:29 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-7,5,main]
Sun Jan 14 19:31:30 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-9,5,main]
Sun Jan 14 19:31:30 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-8,5,main]
Sun Jan 14 19:31:30 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-10,5,main]
Sun Jan 14 19:31:30 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-1,5,main]
Sun Jan 14 19:31:30 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-2,5,main]
Sun Jan 14 19:31:31 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-3,5,main]
Sun Jan 14 19:31:31 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-4,5,main]
Sun Jan 14 19:31:31 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-5,5,main]
Sun Jan 14 19:31:31 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-6,5,main]
Sun Jan 14 19:31:31 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-7,5,main]
Sun Jan 14 19:31:31 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-9,5,main]
Sun Jan 14 19:31:32 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-8,5,main]
Sun Jan 14 19:31:32 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-10,5,main]
Sun Jan 14 19:31:32 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-1,5,main]
Sun Jan 14 19:31:32 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-2,5,main]
Sun Jan 14 19:31:32 CST 2018: get ------
:com.oracle.first.login@31f35411;hashCode:838030353
:Thread[http-nio-8080-exec-3,5,main]