Runner to display useful message

This commit is contained in:
Knut Forkalsrud 2023-11-11 14:38:34 -08:00
parent 6f674599da
commit 88df2961bd
2 changed files with 7 additions and 0 deletions

View file

@ -549,6 +549,12 @@ public class AlbumServlet
lastCacheFlushTime = System.currentTimeMillis(); lastCacheFlushTime = System.currentTimeMillis();
Object baseUrl = getServletContext().getAttribute("album.baseurl");
String url = (baseUrl != null ? String.valueOf(baseUrl) : "http://localhost:8080/photo")
+ "/" + getServletConfig().getServletName() + "/"
+ rootNames.stream().findFirst().orElse("photos") + ".album";
System.out.println("Visit " + url);
} }
private void log4jInit(String resource) { private void log4jInit(String resource) {

View file

@ -18,6 +18,7 @@ public class Runner {
context.setContextPath("/photo"); context.setContextPath("/photo");
context.setParentLoaderPriority(true); context.setParentLoaderPriority(true);
context.setAttribute("album.baseurl", "http://localhost:8080/photo");
server.setHandler(context); server.setHandler(context);
server.start(); server.start();