JSF-Fehlerseite

Aus Info-Theke
Zur Navigation springen Zur Suche springen

web.xml[Bearbeiten]

<error-page>
	<error-code>500</error-code>
	<location>/error.jsp</location>
</error-page>
<error-page>
	<exception-type>404</exception-type>
	<location>/error404.jsp</location>
</error-page>
<error-page>
	<exception-type>java.lang.Exception</exception-type>
	<location>/error.jsp</location>
</error-page>

error.jsp[Bearbeiten]

<%@ page isErrorPage="true" import="java.io.*" %>
<html>
<head>
</head>
<body>
<h1>Diese Seite existiert leider nicht. Benutzen Sie den Back-Button.</h1>
</body>
</html>

error404.jsp[Bearbeiten]


</<%@ page isErrorPage="true" import="java.io.*" %>
<html>
<head>
</head>
<body>
<jsp:forward page="error.jsf" />
</body>
</html>
pre>

== error.xhtml ==
<pre>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jsp/jstl/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:mobi="http://www.icesoft.com/icefaces/mobile/component"
	xmlns:icecore="http://www.icefaces.org/icefaces/core"
	xmlns:ace="http://www.icefaces.org/icefaces/components"
	template="pageframe.xhtml">

	<ui:define name="content">

		<mobi:fieldsetGroup>
			<h2>Entschuldigung, ein interner Fehler ist aufgetreten.</h2>
			<mobi:commandButton id="homeButton" action="home"
				buttonType="default" value="Back" />
		</mobi:fieldsetGroup>

	</ui:define>
</ui:composition>