public void doFilter(ServletRequest req, ServletResponse resp, FilterChain chain) throws ServletException, IOException { String contentType = req.getContentType(); if (contentType != null && contentType.startsWith(FILTERABLE_CONTENT_TYPE)) req.setCharacterEncoding(encoding); chain.doFilter(req, resp); }