view flys-client/src/main/java/de/intevation/flys/client/server/BaseServlet.java @ 3370:08b2472111aa

New implementation of OverviewOutputTab which has a minimalistic chart toolbar and no chart theme panel. The overview image is fetched as single image from server. flys-client/trunk@5078 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Fri, 20 Jul 2012 07:40:55 +0000
parents fba76f4afca9
children
line wrap: on
line source
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 :

http://dive4elements.wald.intevation.org