日期:2014-05-16  浏览次数:20334 次

jsp页面中打印输出异常
try{
   //程序代码,可能会抛出异常
}catch(Exception e){
   StringWriter sw = new StringWriter();
   PrintWriter pw = new PrintWriter(sw);
   ex.printStackTrace(pw);
   out.print(sw);
   sw.close();
   pw.close();
}