Character encoding for incell editing

UI Components for JSF
Post Reply
d.sandmark
Posts: 4
Joined: 21 Oct 2011, 15:44

09 Dec 2011, 16:06

Hi, I'm having some trouble editing a table using <p:rowEditor>

I use encoding='windows-1252' to be able to use Swedish characters (å, ä, ö). Creating an entity works fine but when I edit it in a <p:dataTable> using <p:cellEditor> it commits characters that are unexpected. (If i enter "åäö" and save the edit (using p:celleditor), the table in the database contains "åäö").

My xhtml page starts like this:

Code: Select all

<?xml version='1.0' encoding='windows-1252' ?> 
<!DOCTYPE html>
<html...
I've tried using a Character Encoding Filter:

Code: Select all

public class CharacterEncodingFilter implements Filter {

    private static String ENCODING = "windows-1252";

    @Override
    public void destroy() {
    }

    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        request.setCharacterEncoding(ENCODING);
        response.setCharacterEncoding(ENCODING);
        chain.doFilter(request, response);
    }

    @Override
    public void init(FilterConfig config) throws ServletException {
    }
}
But to no avail. Any ideas why incell editing posts using a different character encoding?

Thanks for your help.
Dennis.
NetBeans 7.0.1
Glassfish 3.1
Primefaces 3.0.M4

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 55 guests