comparison flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java @ 2890:fba76f4afca9

Cosmetics, docs. flys-client/trunk@4573 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Felix Wolfsteller <felix.wolfsteller@intevation.de>
date Mon, 04 Jun 2012 08:21:09 +0000
parents 42d6cf6e10b7
children
comparison
equal deleted inserted replaced
2889:6c613c9f3a51 2890:fba76f4afca9
3 import javax.servlet.ServletException; 3 import javax.servlet.ServletException;
4 import javax.servlet.http.HttpServlet; 4 import javax.servlet.http.HttpServlet;
5 5
6 import org.apache.log4j.Logger; 6 import org.apache.log4j.Logger;
7 7
8 8 /** Documentation goes here. */
9 public class BaseServlet extends HttpServlet { 9 public class BaseServlet extends HttpServlet {
10 10
11 private static Logger logger = Logger.getLogger(BaseServlet.class); 11 private static Logger logger = Logger.getLogger(BaseServlet.class);
12 12
13 13
23 initLogging(); 23 initLogging();
24 initConfigParameters(); 24 initConfigParameters();
25 } 25 }
26 26
27 27
28 /** Init servlet wide logging. */
28 protected void initLogging() { 29 protected void initLogging() {
29 String log4jProperties = System.getenv(LOG4J_PROPERTIES); 30 String log4jProperties = System.getenv(LOG4J_PROPERTIES);
30 31
31 if (log4jProperties == null || log4jProperties.length() == 0) { 32 if (log4jProperties == null || log4jProperties.length() == 0) {
32 String file = getInitParameter("log4j-properties"); 33 String file = getInitParameter("log4j-properties");
38 39
39 LoggingConfigurator.init(log4jProperties); 40 LoggingConfigurator.init(log4jProperties);
40 } 41 }
41 42
42 43
44 /** Set Context Attribute (parameter) from config.xml file. */
43 protected void initConfigParameters() { 45 protected void initConfigParameters() {
44 String url = getInitParameter("server-url"); 46 String url = getInitParameter("server-url");
45 logger.debug("Found server url: " + url); 47 logger.debug("Found server url: " + url);
46 48
47 getServletContext().setAttribute("server-url", url); 49 getServletContext().setAttribute("server-url", url);

http://dive4elements.wald.intevation.org