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*56f072caSAdam HornáčekCopyright (c) 2005, 2018, 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 30*56f072caSAdam Hornáčekorg.opengrok.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 <div id="Masthead">Error</div> 590d40e9d0SAdam Hornáček <div id="sbar"><%@ 600d40e9d0SAdam Hornáček 610d40e9d0SAdam Hornáčekinclude file="menu.jspf" 620d40e9d0SAdam Hornáček 630d40e9d0SAdam Hornáček %></div> 640d40e9d0SAdam Hornáček </div> 650d40e9d0SAdam Hornáček<% 660d40e9d0SAdam Hornáček{ 670d40e9d0SAdam Hornáček PageConfig cfg = PageConfig.get(request); 680d40e9d0SAdam Hornáček String configError = ""; 690d40e9d0SAdam Hornáček if (cfg.getSourceRootPath() == null || cfg.getSourceRootPath().isEmpty()) { 700d40e9d0SAdam Hornáček configError = "CONFIGURATION parameter has not been configured in " 710d40e9d0SAdam Hornáček + "web.xml! Please configure your webapp."; 720d40e9d0SAdam Hornáček } else if (!cfg.getEnv().getSourceRootFile().isDirectory()) { 730d40e9d0SAdam Hornáček configError = "The source root specified in your configuration does " 740d40e9d0SAdam Hornáček + "not point to a valid directory! Please configure your webapp."; 750d40e9d0SAdam Hornáček } 760d40e9d0SAdam Hornáček%><h3 class="error">There was an error!</h3> 770d40e9d0SAdam Hornáček <p class="error"><%= configError %></p><% 780d40e9d0SAdam Hornáček if (exception != null) { 790d40e9d0SAdam Hornáček%> 800d40e9d0SAdam Hornáček <p class="error"><%= exception.getMessage() %></p> 810d40e9d0SAdam Hornáček <pre><% 820d40e9d0SAdam Hornáček StringWriter wrt = new StringWriter(); 830d40e9d0SAdam Hornáček PrintWriter prt = new PrintWriter(wrt); 840d40e9d0SAdam Hornáček exception.printStackTrace(prt); 850d40e9d0SAdam Hornáček prt.close(); 860d40e9d0SAdam Hornáček out.write(Util.htmlize(wrt.toString())); 870d40e9d0SAdam Hornáček %></pre><% 880d40e9d0SAdam Hornáček } else { 890d40e9d0SAdam Hornáček %><p class="error">Unknown Error</p><% 900d40e9d0SAdam Hornáček } 910d40e9d0SAdam Hornáček} 920d40e9d0SAdam Hornáček/* ---------------------- error.jsp end --------------------- */ 930d40e9d0SAdam Hornáček%><%@ 940d40e9d0SAdam Hornáček 950d40e9d0SAdam Hornáčekinclude file="foot.jspf" 960d40e9d0SAdam Hornáček 970d40e9d0SAdam Hornáček%>