src/main/webapp/WEB-INF/jsp/site.jsp

changeset 207
479dd7993ef9
parent 205
7725a79416f3
child 212
c50da26a6d31
--- a/src/main/webapp/WEB-INF/jsp/site.jsp	Mon Aug 02 15:13:04 2021 +0200
+++ b/src/main/webapp/WEB-INF/jsp/site.jsp	Mon Aug 02 17:04:17 2021 +0200
@@ -30,6 +30,9 @@
 <%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
 <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
 
+<%-- Version suffix for forcing browsers to update the CSS / JS files --%>
+<c:set scope="page" var="versionSuffix" value="20210802"/>
+
 <%-- Make the base href easily available at request scope --%>
 <c:set scope="page" var="baseHref" value="${requestScope[Constants.REQ_ATTR_BASE_HREF]}"/>
 
@@ -54,6 +57,9 @@
 <%-- Define an alias for the additional stylesheet --%>
 <c:set scope="page" var="extraCss" value="${requestScope[Constants.REQ_ATTR_STYLESHEET]}"/>
 
+<%-- Define an alias for the optional JS file --%>
+<c:set scope="page" var="javascriptFile" value="${requestScope[Constants.REQ_ATTR_JAVASCRIPT]}"/>
+
 <%-- Load resource bundle --%>
 <fmt:setLocale scope="request" value="${pageContext.response.locale}"/>
 <fmt:setBundle scope="request" basename="localization.strings"/>
@@ -70,15 +76,18 @@
     <c:if test="${not empty redirectLocation}">
         <meta http-equiv="refresh" content="0; URL=${redirectLocation}">
     </c:if>
-    <link rel="stylesheet" href="lightpit.css" type="text/css">
+    <link rel="stylesheet" href="lightpit.css?v=${versionSuffix}" type="text/css">
     <c:if test="${not empty feedHref}">
         <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="${feedHref}"/>
     </c:if>
     <c:if test="${not empty extraCss}">
         <c:forEach items="${extraCss}" var="cssFile">
-            <link rel="stylesheet" href="${cssFile}" type="text/css">
+            <link rel="stylesheet" href="${cssFile}?v=${versionSuffix}" type="text/css">
         </c:forEach>
     </c:if>
+    <c:if test="${not empty javascriptFile}">
+        <script src="${javascriptFile}?v=${versionSuffix}" type="text/javascript"></script>
+    </c:if>
 </head>
 <body>
 <div id="mainMenu">

mercurial