Here you can find the source of Execption2Strings(boolean rep, Throwable... execptions)
public static String Execption2Strings(boolean rep, Throwable... execptions)
//package com.java2s; //License from project: Apache License import java.io.PrintWriter; import java.io.StringWriter; public class Main { public static String Execption2Strings(boolean rep, Throwable... execptions) { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); for (Throwable e : execptions) { e.printStackTrace(pw);//from ww w. ja va 2s.co m } if (rep) { return sw.toString().replaceAll("\r\n|\n\r|\r|\n", "<br/>\n"); } return sw.toString(); } }