Andrew Klochkov wrote:
Igor Vaynberg wrote:
http://herebebeasties.com/2006-12-20/using-a-servlet-filter-for-404-error-page/

I tried this approach under tomcat 5.5.17 but got problems with character encoding. When WicketFilter gets the request to the correct page (defined in the web.xml error-page/location) the request encoding is already set (by tomcat?) to ISO-8859-1 and wicket can't change it. So user gets a page with wrong encoding :-( Googling for the solution didn't help.

You probably need to write a servlet filter that wraps the entire request that sets the encoding:

public class CharsetFilter implements Filter {

    public void init(FilterConfig config) throws ServletException {}
    public void destroy() {}

    public void doFilter(ServletRequest request,
            ServletResponse response, FilterChain chain)
        throws IOException, ServletException
    {
        request.setCharacterEncoding("UTF-8");
        chain.doFilter(request, response);
    }
}

--
Alastair Maw
Wicket-biased blog at http://herebebeasties.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to