我在系统输出中收到以下消息:“FacesMessage(s) 已排队....”。
Sun 的 JavaServer Faces 实现 (1.2_07-b03-FCS) 的解决方案是将其添加到 web.xml 中:
<context-param>
<description>
Set to true to disable the following warning message:
FacesMessage(s) have been enqueued, but may not have been displayed
</description>
<param-name>com.ibm.ws.jsf.disableEnqueuedMessagesWarning</param-name>
<param-value>true</param-value>
</context-param>
但由于某种原因,该解决方案不适用于我正在使用的这个实现 Mojarra (1.2_15-b01-FCS)。
这个文档说我需要简单地更改 RenderResponsePhase 的记录器。
Faces Message(s) habe been encoded...
基本上,我想我问的是我需要为 RenderResponsePhase 配置的记录器类是什么。
最佳答案
该上下文参数特定于 IBM 的 Faces Client Framework,它是 WebSphere 的一部分。但是您似乎根本没有使用它。添加该上下文参数没有意义。将其完全删除。
Mojarra 使用 java.util.logging
API 作为记录器。 JSF 生命周期记录器(RenderResponsePhase
正在使用)的记录器名称是:
javax.enterprise.resource.webcontainer.jsf.lifecycle
记录器可通过 JRE/lib/logging.properties
文件进行配置。您首先需要确定您的服务器环境正在使用什么 JRE(注意:JDK 也有一个 JRE!),然后相应地编辑其 JRE/lib/logging.properties
文件以添加以下行:
javax.enterprise.resource.webcontainer.jsf.lifecycle.level = WARNING
这会将可记录的级别设置为“警告”。 “FacesMessage(s) have been enqueued”消息是一个“INFO”。您需要重新启动服务器(和 IDE,如果有的话!)以使更改生效。
不过,我想知道禁用它有多大用处。您试图隐藏的“问题”的根本原因可能以不同的方式得到更好的解决。
关于java - 在 JSF 1.2 中,我如何更改 RenderResponsePhase 的日志级别?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7162134/