| | |
| | | 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"; |
| | | |
| | |
| | | * @return das ausgefuellte Template |
| | | * @throws IOException |
| | | */ |
| | | public String render(HttpExchange exchange, Map data) throws IOException { |
| | | public String render(HttpExchange exchange, Object data, String template) throws IOException { |
| | | MustacheFactory mf; |
| | | Mustache m; |
| | | HttpHelper helper = new HttpHelper(); |
| | |
| | | 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()); |