Merge branch 'main' into lang_de

This commit is contained in:
2022-04-23 17:06:49 +02:00
9 changed files with 71 additions and 29 deletions

View File

@@ -1,6 +1,7 @@
package de.srsoftware.widerhall.web;
import de.srsoftware.widerhall.Configuration;
import org.stringtemplate.v4.ST;
import org.stringtemplate.v4.STGroup;
import org.stringtemplate.v4.STRawGroupDir;
@@ -8,7 +9,6 @@ import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletResponse;
import java.io.File;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.util.Map;
@@ -24,6 +24,10 @@ public abstract class TemplateServlet extends HttpServlet {
loadTemplates();
}
protected ST getTemplate(String name){
return templates.getInstanceOf(name);
}
protected String loadFile(String filename, HttpServletResponse resp) {
var path = String.join(File.separator,baseDir,"static",filename);
var file = new File(path);