简体   繁体   English

Tapestry的UTF-8编码问题

[英]UTF-8 encoding issue with Tapestry

I have an application already running on a server with Tomcat 6 / Java 6 ( with no encoding error ). 我已经在具有Tomcat 6 / Java 6的服务器上运行了一个应用程序(没有编码错误)。

The application is doing a GET on an URL and receives a XML with informations as a response. 该应用程序正在对URL执行GET,并接收带有信息的XML作为响应。

The informations are displayed in a page with tapestry ( 5.0.18 ). 这些信息显示在带有挂毯(5.0.18)的页面中。

The goal is to upgrade to Java 7 / Tomcat 7. I have an encoding issue on this new application. 目标是升级到Java 7 / Tomcat7。在此新应用程序上,我遇到了编码问题。

From my XML I have fields like this : 从我的XML我有像这样的字段:

<email>mickaël@xxx.com</email>

In my Java Debug I have this : 在我的Java调试中,我有:

email=mickaël@xxx.com

I am displaying the email like this : 我正在显示这样的电子邮件:

${message:user-email-field-label}: ${Profile?.email}

And finally, in my view, I have : 最后,在我看来,我有:

Mes coordonnées : mickaël

So, I did an installation on my local with Java 7 / Tomcat 7. The problem is still here. 因此,我使用Java 7 / Tomcat 7在本地进行了安装。问题仍然存在。 I downgraded to Java 6 / Tomcat 6 and the problem still remains ( and it is not in the running app ). 我降级到Java 6 / Tomcat 6,问题仍然存在(并且它不在运行的应用程序中)。

Concerning the encoding : 关于编码:

But still, looks like my email is interpreted with ISO-8859. 但是,看起来我的电子邮件是使用ISO-8859解释的。 The title from the .properties as mis-interpreted aswell. .properties的标题也被误解了。 My datas that are not displayed with Tapestry have no problems. Tapestry未显示的我的数据没有问题。 Someone has an idea ? 有人有想法吗?

Encoding issues have a wide range of potential causes. 编码问题有多种潜在原因。 You don't seem to mention html headers so it might be as easy as adding the following header to your HTML to tell your browser what to use. 您似乎没有提到html标头,因此将其添加到HTML中以告诉您的浏览器使用什么就像在HTML标头中一样容易。

<meta content="text/html; charset=utf-8" http-equiv="Content-Type">

As a side note, your Tapestry version is pretty old. 附带一提,您的Tapestry版本非常旧。 Released in december 2008 . 2008年12月发行。 You might also like to upgrade to a later version. 您可能还想升级到更高版本。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM