Skip to content
Snippets Groups Projects
Commit b4e1299f authored by Lange, Dr. Herbert's avatar Lange, Dr. Herbert
Browse files

initialize template engine

parent 74515950
No related branches found
No related tags found
No related merge requests found
...@@ -9,6 +9,8 @@ import org.slf4j.Logger; ...@@ -9,6 +9,8 @@ import org.slf4j.Logger;
import java.net.URI; import java.net.URI;
import java.util.ArrayList; import java.util.ArrayList;
import org.apache.velocity.app.Velocity;
/** /**
* @author bba1792 Dr. Herbert Lange * @author bba1792 Dr. Herbert Lange
* @version 20210701 * @version 20210701
...@@ -64,6 +66,12 @@ public class Main { ...@@ -64,6 +66,12 @@ public class Main {
final HttpServer server = startServer(); final HttpServer server = startServer();
System.out.printf("Jersey app started with endpoints available at " System.out.printf("Jersey app started with endpoints available at "
+ "%s%nHit Ctrl-C to stop it...%n", BASE_URI); + "%s%nHit Ctrl-C to stop it...%n", BASE_URI);
// initialize the template engine
Velocity.setProperty(Velocity.RESOURCE_LOADERS, "classpath");
Velocity.addProperty(
"resource.loader.classpath.class",
"org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader");
Velocity.init();
Runtime.getRuntime().addShutdownHook(new Thread(() -> { Runtime.getRuntime().addShutdownHook(new Thread(() -> {
main.logger.info("Shutting down server"); main.logger.info("Shutting down server");
server.shutdown(); server.shutdown();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment