10d40e9d0SAdam Hornáček<%-- 20d40e9d0SAdam HornáčekCDDL HEADER START 30d40e9d0SAdam Hornáček 40d40e9d0SAdam HornáčekThe contents of this file are subject to the terms of the 50d40e9d0SAdam HornáčekCommon Development and Distribution License (the "License"). 60d40e9d0SAdam HornáčekYou may not use this file except in compliance with the License. 70d40e9d0SAdam Hornáček 80d40e9d0SAdam HornáčekSee LICENSE.txt included in this distribution for the specific 90d40e9d0SAdam Hornáčeklanguage governing permissions and limitations under the License. 100d40e9d0SAdam Hornáček 110d40e9d0SAdam HornáčekWhen distributing Covered Code, include this CDDL HEADER in each 120d40e9d0SAdam Hornáčekfile and include the License file at LICENSE.txt. 130d40e9d0SAdam HornáčekIf applicable, add the following below this CDDL HEADER, with the 140d40e9d0SAdam Hornáčekfields enclosed by brackets "[]" replaced with your own identifying 150d40e9d0SAdam Hornáčekinformation: Portions Copyright [yyyy] [name of copyright owner] 160d40e9d0SAdam Hornáček 170d40e9d0SAdam HornáčekCDDL HEADER END 180d40e9d0SAdam Hornáček 19*806e34baSVladimir KotalCopyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved. 200d40e9d0SAdam HornáčekPortions Copyright 2011 Jens Elkner. 21a804b2d7SAdam HornáčekPortions Copyright (c) 2018, Chris Fraire <cfraire@me.com>. 220d40e9d0SAdam Hornáček 230d40e9d0SAdam Hornáček--%> 24a804b2d7SAdam Hornáček<%@page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%> 250d40e9d0SAdam Hornáček<%@page import="javax.servlet.http.HttpServletResponse"%> 260d40e9d0SAdam Hornáček<%@ page session="false" isErrorPage="true" import=" 270d40e9d0SAdam Hornáčekjava.io.PrintWriter, 280d40e9d0SAdam Hornáčekjava.io.StringWriter, 290d40e9d0SAdam Hornáček 30686556f2SAdam Hornáčekorg.opengrok.indexer.web.Util" 310d40e9d0SAdam Hornáček%><% 320d40e9d0SAdam Hornáček/* ---------------------- error.jsp start --------------------- */ 330d40e9d0SAdam Hornáček{ 340d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 350d40e9d0SAdam Hornáček cfg.setTitle("Error!"); 360d40e9d0SAdam Hornáček 370d40e9d0SAdam Hornáček // Set status to Internal error. This should help to avoid caching 380d40e9d0SAdam Hornáček // the page by some proxies. 390d40e9d0SAdam Hornáček response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); 400d40e9d0SAdam Hornáček 410d40e9d0SAdam Hornáček String context = request.getContextPath(); 420d40e9d0SAdam Hornáček} 430d40e9d0SAdam Hornáček%><%@ 440d40e9d0SAdam Hornáček 450d40e9d0SAdam Hornáčekinclude file="httpheader.jspf" 460d40e9d0SAdam Hornáček 470d40e9d0SAdam Hornáček%> 480d40e9d0SAdam Hornáček<body> 490d40e9d0SAdam Hornáček<div id="page"> 500d40e9d0SAdam Hornáček <div id="whole_header"> 510d40e9d0SAdam Hornáček <div id="header"> 520d40e9d0SAdam Hornáček<%@ 530d40e9d0SAdam Hornáček 540d40e9d0SAdam Hornáčekinclude file="pageheader.jspf" 550d40e9d0SAdam Hornáček 560d40e9d0SAdam Hornáček%> 570d40e9d0SAdam Hornáček </div> 580d40e9d0SAdam Hornáček<% 590d40e9d0SAdam Hornáček{ 600d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 610d40e9d0SAdam Hornáček String configError = ""; 620d40e9d0SAdam Hornáček if (cfg.getSourceRootPath() == null || cfg.getSourceRootPath().isEmpty()) { 630d40e9d0SAdam Hornáček configError = "CONFIGURATION parameter has not been configured in " 640d40e9d0SAdam Hornáček + "web.xml! Please configure your webapp."; 650d40e9d0SAdam Hornáček } else if (!cfg.getEnv().getSourceRootFile().isDirectory()) { 660d40e9d0SAdam Hornáček configError = "The source root specified in your configuration does " 670d40e9d0SAdam Hornáček + "not point to a valid directory! Please configure your webapp."; 680d40e9d0SAdam Hornáček } 690d40e9d0SAdam Hornáček%><h3 class="error">There was an error!</h3> 700d40e9d0SAdam Hornáček <p class="error"><%= configError %></p><% 710d40e9d0SAdam Hornáček if (exception != null) { 720d40e9d0SAdam Hornáček%> 730d40e9d0SAdam Hornáček <p class="error"><%= exception.getMessage() %></p> 740d40e9d0SAdam Hornáček <pre><% 750d40e9d0SAdam Hornáček StringWriter wrt = new StringWriter(); 760d40e9d0SAdam Hornáček PrintWriter prt = new PrintWriter(wrt); 770d40e9d0SAdam Hornáček exception.printStackTrace(prt); 780d40e9d0SAdam Hornáček prt.close(); 790d40e9d0SAdam Hornáček out.write(Util.htmlize(wrt.toString())); 800d40e9d0SAdam Hornáček %></pre><% 810d40e9d0SAdam Hornáček } else { 820d40e9d0SAdam Hornáček %><p class="error">Unknown Error</p><% 830d40e9d0SAdam Hornáček } 840d40e9d0SAdam Hornáček} 850d40e9d0SAdam Hornáček/* ---------------------- error.jsp end --------------------- */ 860d40e9d0SAdam Hornáček%><%@ 870d40e9d0SAdam Hornáček 880d40e9d0SAdam Hornáčekinclude file="foot.jspf" 890d40e9d0SAdam Hornáček 900d40e9d0SAdam Hornáček%>