JSF 2.0.3中的英语错误消息(未验证)? [英] English error messages in JSF 2.0.3 (not validation)?

查看:142
本文介绍了JSF 2.0.3中的英语错误消息(未验证)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经成功配置了JSF 1.2,以显示来自服务器的英语错误消息.现在,我正在过渡到JSF 2.0,但是错误消息似乎又回到了德语.如果您想在Google上搜索任何内容,则本地化的错误消息将是一个巨大的痛苦(我不知道谁将本地化的错误消息确定为一件好事!).

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!).

这是 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.

I'm using JSF 2.0.3 as shipped with JBAS 6, plus Seam and RichFaces.

有人知道如何获取英语错误消息吗?也许可以通过部署程序或JBAS 6本身进行配置?

Does anyone know how to get error messages in English language? Maybe config from the deployer or JBAS 6 itself?

从Eclipse内部启动时,错误消息出现在服务器启动时.

the error messages appear at server startup as launched from inside Eclipse.

推荐答案

消息来自您的容器,而不是来自JSF.

The message comes from your container, not from JSF.

启动容器时,可以更改区域设置或添加JVM参数-Duser.language = en.

You can change your regional settings or add the JVM parameter -Duser.language=en when you start the container.

这篇关于JSF 2.0.3中的英语错误消息(未验证)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆