You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2014/12/25 03:29:38 UTC

camel git commit: CAMEL-8179 Added the MyErrorHandler file which I missed to commit

Repository: camel
Updated Branches:
  refs/heads/master 85d0c6528 -> b2b17cd8c


CAMEL-8179 Added the MyErrorHandler file which I missed to commit


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/b2b17cd8
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/b2b17cd8
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/b2b17cd8

Branch: refs/heads/master
Commit: b2b17cd8c1da35b74f6fd375fe545151427ba720
Parents: 85d0c65
Author: Willem Jiang <wi...@gmail.com>
Authored: Thu Dec 25 09:25:19 2014 +0800
Committer: Willem Jiang <wi...@gmail.com>
Committed: Thu Dec 25 10:29:20 2014 +0800

----------------------------------------------------------------------
 .../camel/component/jetty/MyErrorHandler.java   | 42 ++++++++++++++++++++
 1 file changed, 42 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/b2b17cd8/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MyErrorHandler.java
----------------------------------------------------------------------
diff --git a/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MyErrorHandler.java b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MyErrorHandler.java
new file mode 100644
index 0000000..917ae35
--- /dev/null
+++ b/components/camel-jetty/src/test/java/org/apache/camel/component/jetty/MyErrorHandler.java
@@ -0,0 +1,42 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.jetty;
+
+import java.io.IOException;
+import java.io.Writer;
+
+import javax.servlet.http.HttpServletRequest;
+
+import org.eclipse.jetty.server.handler.ErrorHandler;
+
+public class MyErrorHandler extends ErrorHandler {
+    
+    protected void writeErrorPageBody(HttpServletRequest request, Writer writer, int code, String message, boolean showStacks)
+        throws IOException {
+        String uri = request.getRequestURI();
+        
+        writeErrorPageMessage(request, writer, code, message, uri);
+        if (showStacks) {
+            writeErrorPageStacks(request, writer);
+        }
+        writer.write("<hr /><i><small>MyErrorHandler</small></i>");
+        for (int i = 0; i < 20; i++) {
+            writer.write("<br/>                                                \n");
+        }
+    }
+
+}