diff flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java @ 1368:ec0c81f2c7a4

Replaced stdout and stderr logging with log4j loggers in server classes. flys-client/trunk@3071 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Tue, 25 Oct 2011 12:41:16 +0000
parents d0eb2202ffbe
children 2ba44c1b2bab
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java	Tue Oct 25 12:31:15 2011 +0000
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java	Tue Oct 25 12:41:16 2011 +0000
@@ -18,6 +18,12 @@
     {
         System.out.println("BaseServlet.init");
 
+        initLogging();
+        initConfigParameters();
+    }
+
+
+    protected void initLogging() {
         String log4jProperties = getInitParameter("log4j-properties");
 
         if (log4jProperties != null && log4jProperties.length() > 0) {
@@ -33,4 +39,12 @@
 
         System.out.println("BaseServlet.init finished");
     }
+
+
+    protected void initConfigParameters() {
+        String url = getInitParameter("server-url");
+        logger.debug("Found server url: " + url);
+
+        getServletContext().setAttribute("server-url", url);
+    }
 }

http://dive4elements.wald.intevation.org