From 73eed012df8d842738f64dc45ce5f13aad788b5e Mon Sep 17 00:00:00 2001 From: ulrich Date: Wed, 07 Jul 2021 14:52:43 +0000 Subject: [PATCH] Template als Parameter anstelle eines Attributes des HttpContext --- src/de/uhilger/httpserver/template/TemplateActor.java | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/de/uhilger/httpserver/template/TemplateActor.java b/src/de/uhilger/httpserver/template/TemplateActor.java index ce670f6..336c9dd 100644 --- a/src/de/uhilger/httpserver/template/TemplateActor.java +++ b/src/de/uhilger/httpserver/template/TemplateActor.java @@ -45,7 +45,7 @@ public static final String STR_EMPTY = ""; public static final String STR_SLASH = "/"; - public static final String ATTR_TEMPLATE = "template"; + //public static final String ATTR_TEMPLATE = "template"; //public static final String WELCOME_FILE = "index.htmi"; @@ -63,7 +63,7 @@ * @return das ausgefuellte Template * @throws IOException */ - public String render(HttpExchange exchange, Map data) throws IOException { + public String render(HttpExchange exchange, Map data, String template) throws IOException { MustacheFactory mf; Mustache m; HttpHelper helper = new HttpHelper(); @@ -71,7 +71,7 @@ String fileBase = helper.getAttrStr(attributes, FileHandler.ATTR_FILE_BASE, STR_EMPTY); File fileRoot = new File(fileBase); logger.fine("fileRoot: " + fileRoot.getAbsolutePath()); - String template = helper.getAttrStr(attributes, ATTR_TEMPLATE, STR_EMPTY); + //String template = helper.getAttrStr(attributes, ATTR_TEMPLATE, STR_EMPTY); File templateFile = new File(fileRoot, template); if(templateFile.exists()) { logger.fine("using template " + templateFile.getAbsolutePath()); -- Gitblit v1.9.3