JSF 2.0.3 中的英文错误消息(未验证)?
我已成功配置 JSF 1.2 以显示来自服务器的英文错误消息。现在我正在过渡到 JSF 2.0,但错误消息似乎又回到了德语。如果你想用谷歌搜索任何东西,本地化错误消息真的很痛苦(顺便说一句,我不知道是谁决定本地化错误消息是一件好事!)。
这是faces-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config version="2.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
<application>
<!-- view handler only for JSF 1.2 -->
<!--view-handler>com.sun.facelets.FaceletViewHandler</view-handler-->
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>en_US</supported-locale>
</locale-config>
</application>
</faces-config>
我使用 JBAS 6 附带的 JSF 2.0.3,以及 Seam 和 RichFaces。
有谁知道如何获取英文错误消息?也许是来自部署程序或 JBAS 6 本身的配置?
编辑:错误消息出现在从 Eclipse 内部启动的服务器启动时。
I had configured JSF 1.2 successfully to display English error messages that come from the server. Now I was making the transition to JSF 2.0, but the error messages seem to be back to German. Localized error messages are a real pain if you want to google up anything (I have no idea who decided localized error messages to be a good thing BTW!).
Here's the faces-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<faces-config version="2.0"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_0.xsd">
<application>
<!-- view handler only for JSF 1.2 -->
<!--view-handler>com.sun.facelets.FaceletViewHandler</view-handler-->
<locale-config>
<default-locale>en</default-locale>
<supported-locale>en</supported-locale>
<supported-locale>en_US</supported-locale>
</locale-config>
</application>
</faces-config>
I'm using JSF 2.0.3 as shipped with JBAS 6, plus Seam and RichFaces.
Does anyone know how to get error messages in English language? Maybe config from the deployer or JBAS 6 itself?
Edit: the error messages appear at server startup as launched from inside Eclipse.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
该消息来自您的容器,而不是来自 JSF。
您可以更改区域设置或在启动容器时添加 JVM 参数 -Duser.language=en。
The message comes from your container, not from JSF.
You can change your regional settings or add the JVM parameter -Duser.language=en when you start the container.