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:
<?xml version='1.0' encoding='windows-1252' ?>
<!DOCTYPE html>
<html...
I've tried using a Character Encoding Filter:
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?
Using:
- NetBeans 7.0.1
- Glassfish 3.1
- Primefaces 3.0.M4