I need to display build number in my index.jsp page
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>Title (build: BUILDNUMBER )
</head>
The build number can be supplied by maven into a *.properties file.
What is the best way to read *.properties file and display a property with Spring?
You may load the
.propertiesfile as a localization message source (usingResourceBundlerMessageSource) and access it in JSP using<spring:message>or<fmt:message>:src/main/resources/buildInfo.properties:where
buildNumberis exposed as Roland Schneider suggests.Context configuration:
JSP file:
pom.xml: