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

View File

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

View File

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

View File

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