Encoding Problem in Java Web Applications..

..only relevant for first POST request?!?!

web.xml
<filter>
    <filter-name>requestEncodingFilterer</filter-name>
    <filter-class>biz.tugay.RequestEncodingFilter</filter-class>
</filter>
 
<filter-mapping>
    <filter-name>requestEncodingFilterer</filter-name>
    <servlet-name>FacesServlet</servlet-name>
</filter-mapping>

RequestEncodingFilter.java
package biz.tugay;
 
import javax.servlet.*;
import java.io.IOException;
 
/**
 * User: Koray Tugay (koray@tugay.biz)
 * Date: 7/28/2016
 * Time: 8:37 PM
 */
 
public class RequestEncodingFilter implements Filter {
    @Override
    public void init(FilterConfig filterConfig) throws ServletException {
    }
    @Override
    public void doFilter(ServletRequest servletRequest,
                         ServletResponse servletResponse,
                         FilterChain filterChain) throws IOException, ServletException {
        final String characterEncoding = servletRequest.getCharacterEncoding();
        if (characterEncoding == null) {
            servletRequest.setCharacterEncoding("UTF-8");
        }
        filterChain.doFilter(servletRequest, servletResponse);
    }
    @Override
    public void destroy() {
    }
}
I do not know why this happens, but with the first POST request, getCharacterEncoding returns null and I do not know..

Here are some links: 1, 2 , 3!