]> WPIA git - gigi.git/blobdiff - src/club/wpia/gigi/pages/StaticPage.java
upd: rename package name and all references to it
[gigi.git] / src / club / wpia / gigi / pages / StaticPage.java
diff --git a/src/club/wpia/gigi/pages/StaticPage.java b/src/club/wpia/gigi/pages/StaticPage.java
new file mode 100644 (file)
index 0000000..b07004a
--- /dev/null
@@ -0,0 +1,29 @@
+package club.wpia.gigi.pages;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.UnsupportedEncodingException;
+import java.util.HashMap;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import club.wpia.gigi.output.template.Template;
+
+public class StaticPage extends Page {
+
+    private Template content;
+
+    public StaticPage(String title, InputStream content) throws UnsupportedEncodingException {
+        super(title);
+        this.content = new Template(new InputStreamReader(content, "UTF-8"));
+    }
+
+    @Override
+    public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException {
+        HashMap<String, Object> vars = new HashMap<String, Object>();
+        content.output(resp.getWriter(), getLanguage(req), vars);
+    }
+
+}