代码改变世界

Java获取方法的调用者

2012-07-14 15:59 by fangzhao.lee, 976 阅读, 0 推荐, 收藏,
摘要:1 public static String getCaller() 2 { 3 int i; 4 StackTraceElement stack[] = (new Throwable()).getStackTrace(); 5 for (i=0; i < stack.length; i++) 6 { 7 StackTraceElement ste=stack[i]; 8 System.out.println(ste.getClassName()+"."+ste.getMethodName()+"(...);... 阅读全文

Firefox浏览器中,Flex的FileReference上传文件,引发IOError

2012-07-10 12:47 by fangzhao.lee, 481 阅读, 0 推荐, 收藏,
摘要:1. I use Tomcat with realm auhentication (based on cookies)2. I use URLLoader to get some XML data with Struts Action handlersit is usual to set headers to disable cache in the browser like this:response.setHeader("Cache-Control","no-store"); // for HTTP1.1response.setHeader(&quo 阅读全文