Mercurial > dive4elements > river
changeset 3479:40d02fbf414d
Remove the BaseServlet class which is obsolete now
BaseSevlet was used to initialize the logging. This is done by
the BaseServletContextListener now which is loaded before all
Servlets.
flys-client/trunk@5174 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Bjoern Ricks <bjoern.ricks@intevation.de> |
---|---|
date | Wed, 08 Aug 2012 13:09:34 +0000 |
parents | 763789a9acca |
children | 14d37be8541e |
files | flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java flys-client/src/main/java/de/intevation/flys/client/server/CapabilitiesParser.java flys-client/src/main/webapp/WEB-INF/web.xml |
diffstat | 3 files changed, 1 insertions(+), 65 deletions(-) [+] |
line wrap: on
line diff
--- a/flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java Wed Aug 08 13:04:07 2012 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -package de.intevation.flys.client.server; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; - -import org.apache.log4j.Logger; - -/** Documentation goes here. */ -public class BaseServlet extends HttpServlet { - - private static Logger logger = Logger.getLogger(BaseServlet.class); - - - public static final String LOG4J_PROPERTIES = "FLYS_CLIENT_LOG4J_PROPERIES"; - - - @Override - public void init() - throws ServletException - { - System.out.println("BaseServlet.init"); - - initLogging(); - initConfigParameters(); - } - - - /** Init servlet wide logging. */ - protected void initLogging() { - String log4jProperties = System.getenv(LOG4J_PROPERTIES); - - if (log4jProperties == null || log4jProperties.length() == 0) { - String file = getInitParameter("log4j-properties"); - - if (file != null && file.length() > 0) { - log4jProperties = getServletContext().getRealPath(file); - } - } - - LoggingConfigurator.init(log4jProperties); - } - - - /** Set Context Attribute (parameter) from config.xml file. */ - protected void initConfigParameters() { - String url = getInitParameter("server-url"); - logger.debug("Found server url: " + url); - - getServletContext().setAttribute("server-url", url); - } -} -// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :
--- a/flys-client/src/main/java/de/intevation/flys/client/server/CapabilitiesParser.java Wed Aug 08 13:04:07 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/CapabilitiesParser.java Wed Aug 08 13:09:34 2012 +0000 @@ -98,7 +98,7 @@ public static void main(String[] args) { logger.info("Do static Capabilities request/parsing."); - String log4jProperties = System.getenv(BaseServlet.LOG4J_PROPERTIES); + String log4jProperties = System.getenv(BaseServletContextListener.LOG4J_PROPERTIES); LoggingConfigurator.init(log4jProperties); try {
--- a/flys-client/src/main/webapp/WEB-INF/web.xml Wed Aug 08 13:04:07 2012 +0000 +++ b/flys-client/src/main/webapp/WEB-INF/web.xml Wed Aug 08 13:09:34 2012 +0000 @@ -32,18 +32,6 @@ <!-- Servlets --> <servlet> - <servlet-name>BaseServlet</servlet-name> - <servlet-class>de.intevation.flys.client.server.BaseServlet</servlet-class> - - <init-param> - <param-name>log4j-properties</param-name> - <param-value>/WEB-INF/log4j.properties</param-value> - </init-param> - - <load-on-startup>1</load-on-startup> - </servlet> - - <servlet> <servlet-name>user</servlet-name> <servlet-class>de.intevation.flys.client.server.UserServiceImpl</servlet-class> </servlet>