diff options
-rw-r--r-- | org/madore/damlengine/WeblogServlet.java | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/org/madore/damlengine/WeblogServlet.java b/org/madore/damlengine/WeblogServlet.java index 9cf1a75..4baf055 100644 --- a/org/madore/damlengine/WeblogServlet.java +++ b/org/madore/damlengine/WeblogServlet.java @@ -28,18 +28,16 @@ import javax.servlet.http.HttpServletResponse; public class WeblogServlet extends HttpServlet { - private static final long serialVersionUID = 2014100407L; + private static final long serialVersionUID = 2014100701L; @Override - public void doGet(HttpServletRequest request, - HttpServletResponse response) - throws IOException, ServletException + public void init(ServletConfig cfg) + throws ServletException { - + super.init(cfg); // Important! synchronized ( DamlEngine.class ) { if ( DamlEngine.appProps == null ) { DamlEngine.runAsServlet = true; DamlEngine.appProps = new Properties(); - ServletConfig cfg = getServletConfig(); for (Enumeration<String> e = cfg.getInitParameterNames() ; e.hasMoreElements() ; ) { String k = e.nextElement(); DamlEngine.appProps.setProperty(k, cfg.getInitParameter(k)); @@ -53,7 +51,13 @@ public class WeblogServlet extends HttpServlet { if ( DamlEngine.templatePath == null ) DamlEngine.templatePath = DamlEngine.basePath.resolve("templates"); } } + } + @Override + public void doGet(HttpServletRequest request, + HttpServletResponse response) + throws IOException, ServletException + { response.setContentType("text/html; charset=utf-8"); response.setCharacterEncoding("UTF-8"); OutputStream out = response.getOutputStream(); |