<%@ page language="java" contentType="text/html; charset=EUC-KR"%> <%@ page import="java.io.* ,java.util.* "%> <%! static private String getStackTrace(Thread thread) { StringBuffer sb = new StringBuffer(); sb.append("กแ " + thread.getName() + " "); sb.append("prio=" + thread.getPriority() + " "); sb.append(thread.isDaemon() ? "daemon " : " "); StackTraceElement stack[] = thread.getStackTrace(); if (stack==null || stack.length<1) return sb.toString(); if (stack[0].getMethodName().equals("wait")) sb.append("wait \n"); else if (stack[0].getMethodName().equals("sleep")) sb.append("sleep \n"); else sb.append(stack[0].getMethodName() + " \n"); for (int i=0; i at "); else sb.append(" at "); sb.append(className + "." + methodName); sb.append("(" + filename + ":" + (isNativeMethod ? "native" : String.valueOf(line)) + ")"); if (!className.startsWith("java") && !className.startsWith("org.") && !className.startsWith("sun.") && !className.startsWith("com.sun.")) sb.append("-"); sb.append("\n"); } return sb.toString(); } static public String dump() { Hashtable hash = new Hashtable(); StringBuffer sb = new StringBuffer(); ThreadGroup it = Thread.currentThread().getThreadGroup(); Thread[] threads = new Thread[it.activeCount()] ; sb.append("active thread count : " + it.activeCount() + "\n"); it.enumerate(threads); String[] threadNames = new String[threads.length]; for (int i=0; i <% response.setHeader("Pragma", "No-cache"); response.setHeader("Cache-Control", "no-cache"); response.setHeader("Expires", "0"); %>
<%=dump()%>