I got through many "googles" on this topic, but no help came. Thing is, that I set UTF-8 encoding on every single place where I could have (and even could not) but, still data retrieving from inputText is corrupted. I use JSF, Primefaces and Hibernate. When I post to page it is rendered correctly from DB, written as plain text in html doc, even as bean answer.
<h:outputText value="text cez OT: čerstvejší"/><br/>
text cez IDE: čerstvejší<br/><br/>
<h:outputText value="text cez OT_beans: #{temp.dia}"/><br/>
text cez IDE_beans: #{temp.dia}<br/><br/>
<h:outputText value="text cez OT_DBS: #{temp.getDBS()}"/><br/>
text cez IDE_DBS: #{temp.getDBS()}<br/>
Also, when I set the setter of variable to this:
public String getName() {
return "načítané z aplikácie";
}
it renders correctly. Only when I post from page any of "ľščťžýáíé" characters it corrupts to Ä? and common chars. It runs on Appache Tomcat 7.0.34 managed by NetBeans with CDI, JSF 2.2, Primefaces 3.5, Hibernate 3.2.5. UTF-8 encoding set places:
meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> in every header
Connector port="8080" protocol="HTTP/1.1" connectionTimeout="20000" redirectPort="8443" URIEncoding="UTF-8"/> and Connector port="8009" protocol="AJP/1.3" redirectPort="8443" URIEncoding="UTF-8"/> on Appache server
f:view encoding="UTF-8" contentType="text/html">
I also had webFilter, that did not helped:
@Override public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { request.setCharacterEncoding(encoding); response.setCharacterEncoding(encoding); chain.doFilter(request, response); }
Any help ? Additional questions ? THANK YOU !`enter code here
System.out.println()console? Or straight in the DB using some DB admin tool? Or in the rendered HTML output after submitting the form? - BalusC