- server: apache-tomcat-8.0.39
- os: win 10
- jsf: 2.2 (Mojarra)
- java : jre 1.8.0_121
- IDE : Eclipse Neon2
I can't figure out the cause of the following message:
com.sun.faces.renderkit.RenderKitUtils renderUnhandledMessages INFO: WARNING: FacesMessage(s) have been enqueued, but may not have been displayed. sourceId=input[severity=(ERROR 2), summary=(summary message), detail=(detail message)]
I only use the following two files:
IndexBean.java
package com.test.jsf.pckg;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
@ManagedBean
@SessionScoped
public class IndexBean {
private String outcome = "index";
private String userInput = "";
public String getOutcome() {
return outcome;
}
public void setOutcome(String outcome) {
this.outcome = outcome;
}
public String getUserInput() {
return userInput;
}
public void setUserInput(String userInput) {
this.userInput = userInput;
}
public String addFacesMessage() {
FacesContext.getCurrentInstance().addMessage("input", new FacesMessage(FacesMessage.SEVERITY_ERROR, "summary message", "detail message"));
return "";
}
}
index.xhtml
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:c="http://java.sun.com/jsp/jstl/core">
<h:head>
<title>JSF2 PanelGrid and PanelGroup</title>
<style>
.colStyle {
background-color: red;
}
.rowStyle {
font-style: italic;
}
.captionStyle {
background-color: aqua;
font-style: inherit;
font-weight: bolder;
}
.headerStyle {
background-color: yellow;
font-style: oblique;
}
</style>
</h:head>
<h:body>
<h:form>
<h1>
<h:outputText value="panelGrid and panelGroup - Example" />
</h1>
<h2>
<h:outputText value="panelGrid Demo" />
</h2>
<h:panelGrid columns="2" border="1" columnClasses="colStyle,colStyle"
headerClass="headerStyle" captionClass="captionStyle"
rowClasses="rowStyle">
<f:facet name="header">
<h:outputText value="Header - panelGrid" />
</f:facet>
<f:facet name="caption">
<h:outputText value="Caption- panelGrid" />
</f:facet>
<h:outputText value="1st row / 1st column" />
<h:outputText value="1st row / 2nd column" />
<h:outputText value="2nd row / 1st column" />
<h:outputText value="2nd row / 2nd column" />
<h:outputText value="3rd row / 1st column" />
<h:outputText value="3rd row / 2nd column" />
</h:panelGrid>
<h2>
<h:outputText value="panelGroup Demo" />
</h2>
<h:panelGroup id="panelGroup" columns="2">
<h:inputText id="input" value="#{indexBean.userInput}" />
<h:commandButton value="Submit" action="#{indexBean.addFacesMessage}" />
<h:message for="input" showDetail="true" showSummary="false"
errorStyle="color: red;" />
</h:panelGroup>
</h:form>
</h:body>
</html>
The message is displayed in the console when I click on the "Submit" button in the panelGroup.
Any information about the root cause would be greatly appreciated.