Skip to content

Commit

Permalink
Use hostpath consistently.
Browse files Browse the repository at this point in the history
  • Loading branch information
Florian Heinrich authored and arnaudroques committed Jun 1, 2021
1 parent 755b62c commit 6cb587e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
17 changes: 11 additions & 6 deletions src/main/webapp/error.jsp
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
<%@ page isErrorPage="true" contentType="text/html; charset=utf-8" pageEncoding="utf-8" session="false" %>
<%
String contextRoot = request.getContextPath();
%>

<c:set var="contextroot" value="${pageContext.request.contextPath}" />
<c:if test="${(pageContext.request.scheme == 'http' && pageContext.request.serverPort != 80) ||
(pageContext.request.scheme == 'https' && pageContext.request.serverPort != 443) }">
<c:set var="port" value=":${pageContext.request.serverPort}" />
</c:if>
<c:set var="scheme" value="${(not empty header['x-forwarded-proto']) ? header['x-forwarded-proto'] : pageContext.request.scheme}" />
<c:set var="hostpath" value="${scheme}://${pageContext.request.serverName}${port}${contextroot}" />

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
Expand All @@ -10,9 +15,9 @@ String contextRoot = request.getContextPath();
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
<link rel="stylesheet" href="<%=contextRoot %>/plantuml.css" type="text/css"/>
<link rel="icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="<%=contextRoot %>/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="${hostpath}/plantuml.css" type="text/css"/>
<link rel="icon" href="${hostpath}/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="${hostpath}/favicon.ico" type="image/x-icon"/>
<title>PlantUMLServer Error</title>
</head>
<body>
Expand Down
10 changes: 5 additions & 5 deletions src/main/webapp/index.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
<meta http-equiv="expires" content="0" />
<meta http-equiv="pragma" content="no-cache" />
<meta http-equiv="cache-control" content="no-cache, must-revalidate" />
<link rel="icon" href="${contextroot}/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="${contextroot}/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="${contextroot}/plantuml.css" />
<link rel="stylesheet" href="${contextroot}/webjars/codemirror/3.21/lib/codemirror.css" />
<script src="${contextroot}/webjars/codemirror/3.21/lib/codemirror.js"></script>
<link rel="icon" href="${hostpath}/favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="${hostpath}/favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="${hostpath}/plantuml.css" />
<link rel="stylesheet" href="${hostpath}/webjars/codemirror/3.21/lib/codemirror.css" />
<script src="${hostpath}/webjars/codemirror/3.21/lib/codemirror.js"></script>
<!-- <script src="mode/plantuml.js"></script> -->
<script>
window.onload = function() {
Expand Down

0 comments on commit 6cb587e

Please sign in to comment.