package com.github.persapiens.jsfboot;

import javax.servlet.ServletContext;
import lombok.AllArgsConstructor;

@AllArgsConstructor
public abstract class ServletContextConfigurer {
    
    private ServletContext servletContext;
    
    private String preffix;
    
    private boolean isNullOrEmpty(String s)
    {
        return s == null || s.trim().isEmpty();
    }
    
    private String fullName(String name)
    {
        String result = name;
        if (!isNullOrEmpty(preffix))
        {
            result = preffix + "." + result;
        }
        return result;
    }
    
    protected void setInitParameter(String name, String value) {
        if (!isNullOrEmpty(value))
        {
            servletContext.setInitParameter(fullName(name), value);
        }
    }
    
    protected void setInitParameter(String name, Boolean value) {
        if (value != null)
        {
            servletContext.setInitParameter(fullName(name), Boolean.toString(value));
        }
    }
    
    protected void setInitParameter(String name, Long value) {
        if (value != null)
        {
            servletContext.setInitParameter(fullName(name), Long.toString(value));
        }
    }
    
    public abstract void configure();
    
}

@@ -103,16 +103,73 @@
 tructor;
+%0Aimport org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;
 %0A%0A@AllAr
@@ -232,24 +232,135 @@
 urer %7B%0A    %0A
+    private static final Logger logger = LoggerFactory%0A%09%09%09.getLogger(ServletContextConfigurer.class);%0A        %0A
     private 
@@ -742,32 +742,254 @@
 ult;%0A    %7D%0A    %0A
+    private void setInitParameterWithDebug(String name, String value) %7B%0A        name = fullName(name);%0A        %0A        servletContext.setInitParameter(name, value);%0A%0A        logger.debug(name + %22 = %22 + value);%0A    %7D%0A    %0A
     protected vo
@@ -1090,39 +1090,24 @@
             
-servletContext.
 setInitParam
@@ -1110,31 +1110,30 @@
 arameter
-(fullName
+WithDebug
 (name
-)
 , value)
@@ -1266,39 +1266,24 @@
             
-servletContext.
 setInitParam
@@ -1286,31 +1286,30 @@
 arameter
-(fullName
+WithDebug
 (name
-)
 , Boolea
@@ -1457,39 +1457,24 @@
             
-servletContext.
 setInitParam
@@ -1481,23 +1481,22 @@
 eter
-(fullName
+WithDebug
 (name
-)
 , Lo

fix #20