Added version display to layout page footer

This commit is contained in:
tim holloway 2024-03-01 18:21:14 -05:00
parent 6f7ae313ce
commit 200b27e03c
4 changed files with 18 additions and 5 deletions

View File

@ -7,7 +7,7 @@
<groupId>com.mousetech.gourmet</groupId>
<artifactId>gourmetj</artifactId>
<version>0.3.0</version>
<version>0.3.1</version>
<packaging>jar</packaging>
<name>GourmetJ</name>
@ -17,7 +17,7 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>3.2.2</version>
<version>3.2.3</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>

View File

@ -3,6 +3,8 @@ package com.mousetech.gourmetj;
import java.util.ArrayList;
import java.util.List;
import org.springframework.beans.factory.annotation.Value;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.faces.model.SelectItem;
import jakarta.inject.Named;
@ -47,5 +49,12 @@ public class AppBean {
new SelectItem(RecipeSearchType.rst_BY_INGREDIENT.ordinal(),
"Ingredient"));
return list;
}
}
@Value("${appVersion}")
String appVersion = "Not Supplied.";
public String getAppVersion() {
return appVersion;
}
}

View File

@ -18,7 +18,7 @@
</h:head>
<h:body>
<h1>
<ui:insert name="title">Gourmet Recipe Manager (web version)</ui:insert>
<ui:insert name="title">Gourmet Recipe Manager (web version #{appBean.appVersion})</ui:insert>
</h1>
<p:ajaxStatus onerror="PF('opError').show()"/>
<ui:insert name="content">
@ -28,10 +28,11 @@
</ui:insert>
<!-- -->
<div id="footer">
<h:outputText value="Version #{appBean.appVersion}"/><br/>
(C) 2021, 2024 Tim Holloway, Licensed under
the Common Development and Distribution License (CDDL).
<p>Based on Gourmet Recipe Manager by T.
Hinkle</p>
Hinkle.</p>
</div>
<!-- -->
</h:body>

View File

@ -21,6 +21,9 @@ spring:
ddl-auto: none
database-platform: org.hibernate.dialect.MySQLDialect
# From Maven POM:
appVersion: "@project.version@"
# Tracking-modes prevent URL rewrite jsessionid on Primecases
# resources. Which causes "400" errors on initial main.jsf fetch.
server: