NIHVIVO-336 Show the name of the app (context path) in the raw startup-status display.
This commit is contained in:
parent
c6f8a50de6
commit
2bb5b25c7a
2 changed files with 13 additions and 3 deletions
|
@ -68,8 +68,9 @@ public class StartupStatusDisplayFilter implements Filter {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Map<String, Object> bodyMap = new HashMap<String, Object>();
|
Map<String, Object> bodyMap = new HashMap<String, Object>();
|
||||||
bodyMap.put("status", StartupStatus.getBean(ctx));
|
bodyMap.put("status", ss);
|
||||||
bodyMap.put("showLink", !isFatal());
|
bodyMap.put("showLink", !isFatal());
|
||||||
|
bodyMap.put("contextPath", getContextPath());
|
||||||
|
|
||||||
hResp.setStatus(SC_INTERNAL_SERVER_ERROR);
|
hResp.setStatus(SC_INTERNAL_SERVER_ERROR);
|
||||||
Template tpl = loadFreemarkerTemplate();
|
Template tpl = loadFreemarkerTemplate();
|
||||||
|
@ -79,6 +80,15 @@ public class StartupStatusDisplayFilter implements Filter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String getContextPath() {
|
||||||
|
String cp = ctx.getContextPath();
|
||||||
|
if ((cp == null) || cp.isEmpty()) {
|
||||||
|
return "The application";
|
||||||
|
} else {
|
||||||
|
return cp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private Template loadFreemarkerTemplate() throws IOException {
|
private Template loadFreemarkerTemplate() throws IOException {
|
||||||
Configuration cfg = new Configuration();
|
Configuration cfg = new Configuration();
|
||||||
cfg.setTemplateLoader(new WebappTemplateLoader(ctx));
|
cfg.setTemplateLoader(new WebappTemplateLoader(ctx));
|
||||||
|
|
|
@ -79,7 +79,7 @@
|
||||||
<body>
|
<body>
|
||||||
<#if status.errorItems?has_content>
|
<#if status.errorItems?has_content>
|
||||||
<h2>Fatal error</h2>
|
<h2>Fatal error</h2>
|
||||||
<p>VIVO detected a fatal error during startup.</p>
|
<p>${contextPath} detected a fatal error during startup.</p>
|
||||||
<#if showLink>
|
<#if showLink>
|
||||||
<p><a href=".">Continue</a></p>
|
<p><a href=".">Continue</a></p>
|
||||||
</#if>
|
</#if>
|
||||||
|
@ -90,7 +90,7 @@
|
||||||
|
|
||||||
<#if status.warningItems?has_content>
|
<#if status.warningItems?has_content>
|
||||||
<h2>Warning</h2>
|
<h2>Warning</h2>
|
||||||
<p>VIVO issued warnings during startup.</p>
|
<p>${contextPath} found problems during startup.</p>
|
||||||
<#if showLink>
|
<#if showLink>
|
||||||
<p><a href=".">Continue</a></p>
|
<p><a href=".">Continue</a></p>
|
||||||
</#if>
|
</#if>
|
||||||
|
|
Loading…
Add table
Reference in a new issue