tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r557466 - /tomcat/container/branches/tc4.1.x/webapps/examples/WEB-INF/classes/SendMailServlet.java
Date Thu, 19 Jul 2007 02:39:09 GMT
Author: markt
Date: Wed Jul 18 19:39:08 2007
New Revision: 557466

URL: http://svn.apache.org/viewvc?view=rev&rev=557466
Log:
Filter output.

Modified:
    tomcat/container/branches/tc4.1.x/webapps/examples/WEB-INF/classes/SendMailServlet.java

Modified: tomcat/container/branches/tc4.1.x/webapps/examples/WEB-INF/classes/SendMailServlet.java
URL: http://svn.apache.org/viewvc/tomcat/container/branches/tc4.1.x/webapps/examples/WEB-INF/classes/SendMailServlet.java?view=diff&rev=557466&r1=557465&r2=557466
==============================================================================
--- tomcat/container/branches/tc4.1.x/webapps/examples/WEB-INF/classes/SendMailServlet.java
(original)
+++ tomcat/container/branches/tc4.1.x/webapps/examples/WEB-INF/classes/SendMailServlet.java
Wed Jul 18 19:39:08 2007
@@ -20,6 +20,8 @@
 
 import java.io.IOException;
 import java.io.PrintWriter;
+import java.io.StringWriter;
+
 import javax.mail.Message;
 import javax.mail.Session;
 import javax.mail.Transport;
@@ -33,6 +35,8 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import util.HTMLFilter;
+
 
 
 /**
@@ -96,9 +100,12 @@
         } catch (Throwable t) {
 
             writer.println("<font color=\"red\">");
-            writer.println("ENCOUNTERED EXCEPTION:  " + t);
+            writer.print("ENCOUNTERED EXCEPTION:  ");
+            writer.println(HTMLFilter.filter(t.toString()));
             writer.println("<pre>");
-            t.printStackTrace(writer);
+            StringWriter trace = new StringWriter();
+            t.printStackTrace(new PrintWriter(trace));
+            writer.print(HTMLFilter.filter(trace.toString()));
             writer.println("</pre>");
             writer.println("</font>");
 



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message