error.jsp revision 607
e966b997b5ff620f957014251378a447bbea959fTim Reddehase<%--
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseCDDL HEADER START
e966b997b5ff620f957014251378a447bbea959fTim Reddehase
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseThe contents of this file are subject to the terms of the
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseCommon Development and Distribution License (the "License").
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseYou may not use this file except in compliance with the License.
e966b997b5ff620f957014251378a447bbea959fTim Reddehase
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseSee LICENSE.txt included in this distribution for the specific
e966b997b5ff620f957014251378a447bbea959fTim Reddehaselanguage governing permissions and limitations under the License.
e966b997b5ff620f957014251378a447bbea959fTim Reddehase
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseWhen distributing Covered Code, include this CDDL HEADER in each
e966b997b5ff620f957014251378a447bbea959fTim Reddehasefile and include the License file at LICENSE.txt.
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseIf applicable, add the following below this CDDL HEADER, with the
e966b997b5ff620f957014251378a447bbea959fTim Reddehasefields enclosed by brackets "[]" replaced with your own identifying
e966b997b5ff620f957014251378a447bbea959fTim Reddehaseinformation: Portions Copyright [yyyy] [name of copyright owner]
e966b997b5ff620f957014251378a447bbea959fTim Reddehase
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseCDDL HEADER END
e966b997b5ff620f957014251378a447bbea959fTim Reddehase
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseCopyright 2007 Sun Microsystems, Inc. All rights reserved.
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseUse is subject to license terms.
e966b997b5ff620f957014251378a447bbea959fTim Reddehase
e966b997b5ff620f957014251378a447bbea959fTim Reddehase--%><%@ page import = "javax.servlet.*,
e966b997b5ff620f957014251378a447bbea959fTim Reddehasejavax.servlet.http.*,
e966b997b5ff620f957014251378a447bbea959fTim Reddehasejava.io.*,
e966b997b5ff620f957014251378a447bbea959fTim Reddehaseorg.opensolaris.opengrok.configuration.*"
e966b997b5ff620f957014251378a447bbea959fTim Reddehase%><%@ page session="false" %><%@ page isErrorPage="true" %><%
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseString context = request.getContextPath();
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseRuntimeEnvironment environment = RuntimeEnvironment.getInstance();
e966b997b5ff620f957014251378a447bbea959fTim Reddehaseenvironment.setUrlPrefix(context + "/s?");
e966b997b5ff620f957014251378a447bbea959fTim Reddehaseenvironment.register();
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseString rawSource = environment.getSourceRootPath();
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseString configError = "";
e966b997b5ff620f957014251378a447bbea959fTim Reddehaseif ("".equals(rawSource)) {
e966b997b5ff620f957014251378a447bbea959fTim Reddehase configError = "SRC_ROOT parameter has not been configured in web.xml! Please configure your webapp.";
e966b997b5ff620f957014251378a447bbea959fTim Reddehase} else {
e966b997b5ff620f957014251378a447bbea959fTim Reddehase if (environment.getSourceRootFile() == null || !environment.getSourceRootFile().isDirectory()) {
e966b997b5ff620f957014251378a447bbea959fTim Reddehase configError = "SRC_ROOT parameter in web.xml does not point to a valid directory! Please configure your webapp.";
e966b997b5ff620f957014251378a447bbea959fTim Reddehase }
e966b997b5ff620f957014251378a447bbea959fTim Reddehase}
e966b997b5ff620f957014251378a447bbea959fTim ReddehaseString pageTitle = "Error!";
e966b997b5ff620f957014251378a447bbea959fTim Reddehase%><%@ include file="httpheader.jspf" %>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase<body>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase<div id="page">
e966b997b5ff620f957014251378a447bbea959fTim Reddehase <div id="header">
e966b997b5ff620f957014251378a447bbea959fTim Reddehase <%@ include file="pageheader.jspf" %>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase </div>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase<div id="Masthead"></div>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase<div id="bar"><a id="home" href="<%=context%>">Home</a> | <input id="search" name="q" class="q"/> <input type="submit" value="Search" class="submit"/> </div>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase<h3 class="error">There was an error!</h3>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase<p><%=configError%>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase</p><pre><%
e966b997b5ff620f957014251378a447bbea959fTim Reddehase StringWriter wrt = new StringWriter();
e966b997b5ff620f957014251378a447bbea959fTim Reddehase PrintWriter prt = new PrintWriter(wrt);
e966b997b5ff620f957014251378a447bbea959fTim Reddehase exception.printStackTrace(prt);
e966b997b5ff620f957014251378a447bbea959fTim Reddehase prt.flush();
e966b997b5ff620f957014251378a447bbea959fTim Reddehase out.write(wrt.toString());
e966b997b5ff620f957014251378a447bbea959fTim Reddehase prt.close();
e966b997b5ff620f957014251378a447bbea959fTim Reddehase%>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase</pre>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase<p>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase<%=exception.getMessage()%>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase</p>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase<%@include file="foot.jspf"%>
e966b997b5ff620f957014251378a447bbea959fTim Reddehase