@Override
    public void init(ServletConfig config) throws ServletException {
        logMessages(Level.INFO, "Initializing the dispatcher servlet");
        logMessages(Level.INFO, "Reading the router from the init parameter");
        String routerClzName = config.getInitParameter(
                ROUTER_CLASS_NAME_INIT_PARAM);
        logMessages(Level.INFO, "Using the router: ", routerClzName);
        try {
            Class<?> routerClz = Class.forName(routerClzName);
            Constructor constructor = routerClz.getConstructor();
            router = (Router) constructor.newInstance();
        } catch (NoSuchMethodException ex) {
            logMessages(Level.SEVERE, "Rounter class: ", routerClzName,
                    " requires a constructor with parameters");
            logException(ex);
        } catch (Exception ex) {
            logException(ex);
        }
    }