Wed, 13 May 2020 21:46:26 +0200
fixes error pages and adds referer link to error page if it comes from the application
universe@13 | 1 | <%-- |
universe@13 | 2 | DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
universe@13 | 3 | |
universe@24 | 4 | Copyright 2018 Mike Becker. All rights reserved. |
universe@13 | 5 | |
universe@13 | 6 | Redistribution and use in source and binary forms, with or without |
universe@13 | 7 | modification, are permitted provided that the following conditions are met: |
universe@13 | 8 | |
universe@13 | 9 | 1. Redistributions of source code must retain the above copyright |
universe@13 | 10 | notice, this list of conditions and the following disclaimer. |
universe@13 | 11 | |
universe@13 | 12 | 2. Redistributions in binary form must reproduce the above copyright |
universe@13 | 13 | notice, this list of conditions and the following disclaimer in the |
universe@13 | 14 | documentation and/or other materials provided with the distribution. |
universe@13 | 15 | |
universe@13 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
universe@13 | 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
universe@13 | 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
universe@13 | 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
universe@13 | 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
universe@13 | 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
universe@13 | 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
universe@13 | 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
universe@13 | 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
universe@13 | 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
universe@13 | 26 | --%> |
universe@39 | 27 | <%@page contentType="text/html" pageEncoding="UTF-8" trimDirectiveWhitespaces="true" %> |
universe@13 | 28 | <%@page import="de.uapcore.lightpit.Constants" %> |
universe@13 | 29 | <%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> |
universe@13 | 30 | <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %> |
universe@13 | 31 | <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> |
universe@13 | 32 | |
universe@46 | 33 | <%-- Make the base href easily available at request scope --%> |
universe@46 | 34 | <c:set scope="request" var="baseHref" value="${pageContext.request.scheme}://${pageContext.request.serverName}:${pageContext.request.serverPort}${pageContext.request.contextPath}/" /> |
universe@46 | 35 | |
universe@45 | 36 | <%-- Define an alias for the request path --%> |
universe@45 | 37 | <c:set scope="page" var="requestPath" value="${requestScope[Constants.REQ_ATTR_PATH]}"/> |
universe@45 | 38 | |
universe@13 | 39 | <%-- Define an alias for the main menu --%> |
universe@13 | 40 | <c:set scope="page" var="mainMenu" value="${requestScope[Constants.REQ_ATTR_MENU]}"/> |
universe@13 | 41 | |
universe@45 | 42 | <%-- Define an alias for the sub menu --%> |
universe@45 | 43 | <c:set scope="page" var="subMenu" value="${requestScope[Constants.REQ_ATTR_SUB_MENU]}"/> |
universe@45 | 44 | |
universe@13 | 45 | <%-- Define an alias for the fragment name --%> |
universe@13 | 46 | <c:set scope="page" var="fragment" value="${requestScope[Constants.REQ_ATTR_FRAGMENT]}"/> |
universe@13 | 47 | |
universe@13 | 48 | <%-- Define an alias for the additional stylesheet --%> |
universe@13 | 49 | <c:set scope="page" var="extraCss" value="${requestScope[Constants.REQ_ATTR_STYLESHEET]}"/> |
universe@13 | 50 | |
universe@13 | 51 | <%-- Define an alias for the module info --%> |
universe@13 | 52 | <c:set scope="page" var="moduleInfo" value="${requestScope[Constants.REQ_ATTR_MODULE_INFO]}"/> |
universe@13 | 53 | |
universe@15 | 54 | <%-- Apply the session locale (should always be present, but check nevertheless) --%> |
universe@15 | 55 | <c:if test="${not empty sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"> |
universe@15 | 56 | <fmt:setLocale scope="request" value="${sessionScope[Constants.SESSION_ATTR_LANGUAGE]}"/> |
universe@15 | 57 | </c:if> |
universe@15 | 58 | |
universe@13 | 59 | <!DOCTYPE html> |
universe@13 | 60 | <html> |
universe@13 | 61 | <head> |
universe@46 | 62 | <base href="${baseHref}"> |
universe@13 | 63 | <title>LightPIT - |
universe@13 | 64 | <fmt:bundle basename="${moduleInfo.bundleBaseName}"> |
universe@13 | 65 | <fmt:message key="${moduleInfo.titleKey}" /> |
universe@13 | 66 | </fmt:bundle> |
universe@13 | 67 | </title> |
universe@13 | 68 | <meta charset="UTF-8"> |
universe@13 | 69 | <link rel="stylesheet" href="lightpit.css" type="text/css"> |
universe@13 | 70 | <c:if test="${not empty extraCss}"> |
universe@13 | 71 | <link rel="stylesheet" href="${extraCss}" type="text/css"> |
universe@13 | 72 | </c:if> |
universe@13 | 73 | </head> |
universe@13 | 74 | <body> |
universe@13 | 75 | <div id="mainMenu"> |
universe@13 | 76 | <c:forEach var="menu" items="${mainMenu}"> |
universe@45 | 77 | <%@ include file="../jspf/menu-entry.jspf" %> |
universe@13 | 78 | </c:forEach> |
universe@13 | 79 | </div> |
universe@45 | 80 | <c:if test="${not empty subMenu}"> |
universe@45 | 81 | <div id="subMenu"> |
universe@45 | 82 | <c:forEach var="menu" items="${subMenu}"> |
universe@45 | 83 | <%@ include file="../jspf/menu-entry.jspf" %> |
universe@45 | 84 | </c:forEach> |
universe@45 | 85 | </div> |
universe@45 | 86 | </c:if> |
universe@13 | 87 | <div id="content-area"> |
universe@13 | 88 | <c:if test="${not empty fragment}"> |
universe@15 | 89 | <fmt:setBundle scope="request" basename="${moduleInfo.bundleBaseName}"/> |
universe@15 | 90 | <c:import url="${fragment}" /> |
universe@13 | 91 | </c:if> |
universe@13 | 92 | </div> |
universe@13 | 93 | </body> |
universe@13 | 94 | </html> |