Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Character encoding jsf2+;雄猫7_Character Encoding_Jsf 2_Tomcat7_Content Encoding - Fatal编程技术网

Character encoding jsf2+;雄猫7

Character encoding jsf2+;雄猫7,character-encoding,jsf-2,tomcat7,content-encoding,Character Encoding,Jsf 2,Tomcat7,Content Encoding,我有一个表单,只有一个字段。当我提交表单时,字段的值变得奇怪。单词Extremação变成ExtremaçÃo 因此,我已经在我的应用程序的每个地方设置了UTF-8编码: <?xml version="1.0" encoding="UTF-8"?> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> <f:view contentType="text/html" encodin

我有一个表单,只有一个字段。当我提交表单时,字段的值变得奇怪。单词Extremação变成ExtremaçÃo

因此,我已经在我的应用程序的每个地方设置了UTF-8编码:

<?xml version="1.0" encoding="UTF-8"?>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<f:view contentType="text/html" encoding="UTF-8">
<h:form id="formParamSupremo"  prependId="false" acceptcharset="UTF-8">
我的http头是这样的:

host = localhost:8080
user-agent = Mozilla/5.0 (X11; U; Linux x86_64; pt-BR; rv:1.9.2.23) Gecko/20110921
user-agent = Mozilla/5.0 (X11; U; Linux x86_64; pt-BR; rv:1.9.2.23) Gecko/20110921        Ubuntu/10.04 (lucid) Firefox/3.6.23
accept = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
accept-language = pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
accept-encoding = gzip,deflate
accept-charset = ISO-8859-1,utf-8;q=0.7,*;q=0.7
keep-alive = 115
connection = keep-alive
referer = http://localhost:8080/parametros/view/xhtml/parametrosSupremo.jsf
cookie = JSESSIONID=6DC0C1D4434FB90C3F9271D6C54DC575
content-type = application/x-www-form-urlencoded
content-length = 185

我也有同样的问题

最后我找到了这个错误的解决方案。您应该创建一个过滤器来显示非ascIi字符。多么讨厌的虫子啊:(


“Extremação一词变成ExtremaçÃo。”您究竟在哪里检查值?在数据库中还是通过
System.out.println()检查
在您的IDE中?或在浏览器的结果页中?您使用的是JSP还是Facelets?您已经编辑了您的帖子,但没有对我的上述评论给出任何反馈。为什么?您不想帮助我们帮助您吗?我正在检查IDE中的值(setter方法)。我正在使用facelets。哪个IDE?Eclipse?您是如何检查它的?通过
System.out.println()
还是在调试器变量视图中?提交后webbrowser中的值是什么?HTTP响应的
内容类型
头的值是什么?(您只显示了HTTP请求头)。您使用的浏览器是什么?MSIE的
acceptcharset
有一个主要问题。这一个也解决了我的问题。谢谢Hung,谢谢Paulo Vitor。
host = localhost:8080
user-agent = Mozilla/5.0 (X11; U; Linux x86_64; pt-BR; rv:1.9.2.23) Gecko/20110921
user-agent = Mozilla/5.0 (X11; U; Linux x86_64; pt-BR; rv:1.9.2.23) Gecko/20110921        Ubuntu/10.04 (lucid) Firefox/3.6.23
accept = text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
accept-language = pt-br,pt;q=0.8,en-us;q=0.5,en;q=0.3
accept-encoding = gzip,deflate
accept-charset = ISO-8859-1,utf-8;q=0.7,*;q=0.7
keep-alive = 115
connection = keep-alive
referer = http://localhost:8080/parametros/view/xhtml/parametrosSupremo.jsf
cookie = JSESSIONID=6DC0C1D4434FB90C3F9271D6C54DC575
content-type = application/x-www-form-urlencoded
content-length = 185