working on css

This commit is contained in:
2022-04-23 01:34:14 +02:00
parent 3ffab25635
commit 0858417fa9
6 changed files with 78 additions and 4 deletions

View File

@@ -29,8 +29,10 @@ public abstract class TemplateServlet extends HttpServlet {
var file = new File(path);
if (!file.exists()) return t("File {} does not exist!",filename);
try {
var content = Files.readString(file.toPath());
resp.getWriter().println(content);
var content = Files.readAllBytes(file.toPath());
var out = resp.getOutputStream();
out.write(content);
out.flush();
} catch (IOException e) {
return t("Failed to load file '{}'!",filename);
}

View File

@@ -306,7 +306,12 @@ public class Web extends TemplateServlet {
case "jquery":
resp.setContentType("text/javascript");
return loadFile("jquery-3.6.0.min.js",resp);
case UNSUBSCRIBE:
case "OpenSans-Regular.woff":
resp.setContentType("font/woff");
return loadFile("OpenSans-Regular.woff",resp);
case "Bhineka.ttf":
resp.setContentType("font/ttf");
return loadFile("Bhineka.ttf",resp); case UNSUBSCRIBE:
data.put(LIST,list.email());
return loadTemplate(path,data,resp);