Re: [solved] PWC4011: Unable to set request character encoding to UTF-8 from context

Splash Forums PrettyFaces Users [solved] PWC4011: Unable to set request character encoding to UTF-8 from context Re: [solved] PWC4011: Unable to set request character encoding to UTF-8 from context

#21405

m1m
Participant

OK I solve the problem.

http://ocpsoft.com/support/topic/pwc4011-unable-to-set-request-character-encoding-to-utf-8-from-context#post-1795 works only for request encoding, but I still need response encoding.

Glassfish defaults response encoding to iso8859-1 http://download.oracle.com/docs/cd/E19798-01/821-1752/beafw/index.html, so CharacterEncodingFilter would contain only

response.setCharacterEncoding("UTF-8");
chain.doFilter(request, response);

BUT with no try-catch clause (this causes problems described here http://ocpsoft.com/support/topic/custom-error-page-not-working) instead use

‘public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException’