Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
corpus-web-services
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lange, Dr. Herbert
corpus-web-services
Commits
b4e1299f
Commit
b4e1299f
authored
3 years ago
by
Lange, Dr. Herbert
Browse files
Options
Downloads
Patches
Plain Diff
initialize template engine
parent
74515950
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/de/uni_hamburg/corpora/server/Main.java
+8
-0
8 additions, 0 deletions
src/main/java/de/uni_hamburg/corpora/server/Main.java
with
8 additions
and
0 deletions
src/main/java/de/uni_hamburg/corpora/server/Main.java
+
8
−
0
View file @
b4e1299f
...
@@ -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
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment