@Override
    public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
            throws IOException, ServletException {

        // Conditionally select and set the character encoding to be used
        if (this.ignore || request.getCharacterEncoding() == null) {
            String encod = selectEncoding();
            if (encod != null) {
                request.setCharacterEncoding(encod);
            }
        }
        if (log.isDebugEnabled()) {
            log.debug("CONTENT-TYPE(request):" + request.getContentType()); //$NON-NLS-1$
            log.debug("CONTENT-TYPE(response):" + response.getContentType()); //$NON-NLS-1$
            log.debug("CharacterEncoding:" + request.getCharacterEncoding()); //$NON-NLS-1$
            log.debug("headers"); //$NON-NLS-1$
            Enumeration enumeration1 = ((HttpServletRequest)request).getHeaderNames();
            while (enumeration1.hasMoreElements()) {
                String key = (String)enumeration1.nextElement();
                log.debug(key + "=" + ((HttpServletRequest)request).getHeader(key)); //$NON-NLS-1$
            }
            log.debug("atributes"); //$NON-NLS-1$
            Enumeration enumeration = request.getAttributeNames();
            while (enumeration.hasMoreElements()) {
                String key = (String)enumeration.nextElement();
                log.debug(key + "=" + request.getAttribute(key)); //$NON-NLS-1$
            }

            log.debug("parameters"); //$NON-NLS-1$
            Iterator it = request.getParameterMap().entrySet().iterator();
            while (it.hasNext()) {
                log.debug(it.next());
            }
        }
        // Pass control on to the next filter
        chain.doFilter(request, response);

    }