Fehler-Seiten angelegt und zugehörige Test-Links aufgenommen
authorKai Moritz <kai@juplo.de>
Tue, 28 Jan 2014 16:08:28 +0000 (17:08 +0100)
committerKai Moritz <kai@juplo.de>
Tue, 19 Jan 2016 16:45:41 +0000 (17:45 +0100)
src/main/webapp/WEB-INF/404.jsp
src/main/webapp/WEB-INF/error.jsp [new file with mode: 0644]
src/main/webapp/WEB-INF/templates/test/experimente.jsp
src/main/webapp/WEB-INF/views/test/error.jsp [new file with mode: 0644]
src/main/webapp/WEB-INF/web.xml

index 11c449f..9218707 100644 (file)
@@ -1,6 +1,7 @@
 <%@page contentType="text/html;charset=UTF-8"%>
 <%@page pageEncoding="UTF-8"%>
 <%@page session="false" %>
 <%@page contentType="text/html;charset=UTF-8"%>
 <%@page pageEncoding="UTF-8"%>
 <%@page session="false" %>
+<%@page isErrorPage="true" %>
 <%@taglib uri="http://tiles.apache.org/tags-tiles" prefix="t" %>
 <%@taglib uri="http://www.springframework.org/tags" prefix="s"%>
 <s:url var="base" value="/" />
 <%@taglib uri="http://tiles.apache.org/tags-tiles" prefix="t" %>
 <%@taglib uri="http://www.springframework.org/tags" prefix="s"%>
 <s:url var="base" value="/" />
diff --git a/src/main/webapp/WEB-INF/error.jsp b/src/main/webapp/WEB-INF/error.jsp
new file mode 100644 (file)
index 0000000..5644494
--- /dev/null
@@ -0,0 +1,36 @@
+<%@page contentType="text/html;charset=UTF-8"%>
+<%@page pageEncoding="UTF-8"%>
+<%@page session="false" %>
+<%@page isErrorPage="true" %>
+<%@taglib uri="http://tiles.apache.org/tags-tiles" prefix="t" %>
+<%@taglib uri="http://www.springframework.org/tags" prefix="s"%>
+<s:url var="base" value="/" />
+<t:insertDefinition name="NOMENU">
+  <t:putAttribute name="contentclass" value="nomenu withbackground" type="string"/>
+  <t:putAttribute name="title" value="An unexpected Error occured!" type="string"/>
+  <t:putAttribute name="breadcrumb">
+    <li class="b"><a class="b" href="${base}index.html">Home</a></li>
+    <li class="b"><strong class="b">!#%*§</strong></li>
+  </t:putAttribute>
+  <t:putAttribute name="maincontent" type="string">
+    <span class="background sehrhell" id="bs1">x</span>
+    <span class="background heller" id="bs2">#</span>
+    <span class="background sehrhell" id="bs3">*</span>
+    <span class="background heller" id="bs4">%</span>
+    <span class="background sehrhell" id="bs5">§</span>
+    <span class="background sehrhell" id="bs6">?</span>
+    <span class="background heller" id="bs7">?</span>
+    <span class="background heller" id="bs8">?</span>
+    <span class="background heller" id="bs9">?</span>
+    <p>We do not know, what happend.</p>
+    <p>But we can tell you: WE ARE SORRY!</p>
+    <p>Really.</p>
+    <ul>
+      <li>${pageContext.errorData.statusCode}</li>
+      <li>${pageContext.errorData.requestURI}</li>
+      <li>${pageContext.errorData.servletName}</li>
+      <li>${pageContext.errorData.throwable}</li>
+    </ul>
+  </t:putAttribute>
+  <t:putAttribute name="marginalcontent" type="string" value=""/>
+</t:insertDefinition>
index 91608d3..cb00a9c 100644 (file)
@@ -3,10 +3,12 @@
 <%@page session="false" %>
 <%@taglib uri="http://www.springframework.org/tags" prefix="s"%>
 <s:url var="base" value="/" />
 <%@page session="false" %>
 <%@taglib uri="http://www.springframework.org/tags" prefix="s"%>
 <s:url var="base" value="/" />
-<h2>HTML-Elemente</h2>
+<h2>HTML-Elemente / spezielle Seiten</h2>
 <ul>
   <li><a href="${base}test/formulare.html">Formulare</a></li>
   <li><a href="${base}test/symbole.html">Symbol-Font</a></li>
 <ul>
   <li><a href="${base}test/formulare.html">Formulare</a></li>
   <li><a href="${base}test/symbole.html">Symbol-Font</a></li>
+  <li><a href="${base}test/gibts-ja-gar-nicht.html">404-Fehlerseite</a></li>
+  <li><a href="${base}test/error.html">Fehlerseite für andere Fehler</a></li>
 </ul>
 <h2>Layout-Grenzfälle</h2>
 <ul>
 </ul>
 <h2>Layout-Grenzfälle</h2>
 <ul>
diff --git a/src/main/webapp/WEB-INF/views/test/error.jsp b/src/main/webapp/WEB-INF/views/test/error.jsp
new file mode 100644 (file)
index 0000000..5e8e4e1
--- /dev/null
@@ -0,0 +1,12 @@
+<%@page contentType="text/html;charset=UTF-8"%>
+<%@page pageEncoding="UTF-8"%>
+<%@page session="false" %>
+<%@taglib uri="http://tiles.apache.org/tags-tiles" prefix="t" %>
+<%@taglib uri="http://www.springframework.org/tags" prefix="s"%>
+<s:url var="base" value="/" />
+<t:insertDefinition name="test">
+  <t:putAttribute name="title" value="Diese Seite erzeugt einen Fehler!" type="string"/>
+  <t:putAttribute name="maincontent" type="string">
+    <% Integer.parseInt("foo"); //throws an exception %>
+  </t:putAttribute>
+</t:insertDefinition>
index 6a618b8..6eb68da 100644 (file)
@@ -62,5 +62,8 @@
     <error-code>404</error-code>
     <location>/WEB-INF/404.jsp</location>
   </error-page>
     <error-code>404</error-code>
     <location>/WEB-INF/404.jsp</location>
   </error-page>
+  <error-page>
+    <location>/WEB-INF/error.jsp</location>
+  </error-page>
 
 </web-app>
 
 </web-app>