@Override
    public void doFilter(ServletRequest request, ServletResponse response,
            FilterChain chain) throws IOException, ServletException
    {
        request.setCharacterEncoding("UTF-8");
        response.setContentType("text/html; charset=" + "UTF-8");
        chain.doFilter(request, response);
    }
Sets the character encoding to be used for any content passing out of this filter.
xmppserver/src/main/java/org/jivesoftware/util/SetCharacterEncodingFilter.java