1

フィールドが 1 つだけのフォームが 1 つあります。フォームを送信すると、フィールドの値がおかしくなりました。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">

私も1つのエンコーディングフィルターを作成しました:

request.setCharacterEncoding("UTF-8");
response.setContentType("text/html; charset=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
4

1 に答える 1

3

私も同じ問題を抱えてる。

最後に、このエラーの解決策を見つけました。非ASCII文字を表示するには、フィルターを作成する必要があります。なんて厄介なバグ:(

http://dertompson.com/2007/01/29/encoding-filter-for-java-web-applications/

于 2012-04-25T11:34:44.510 に答える