After update from JSF 2.1 to 2.2, I start getting the following error message:
The metadata component needs to be nested within a f:metadata tag. Suggestion: enclose the necessary components within <f:metadata>
It's a bit weird as the code looks like this:
....
<ui:composition template="./resources/templates/template_base.xhtml">
<ui:define name="contentBody">
<h:outputStylesheet library="css/table" name="tableContent.css" />
<h:outputScript library="javascript" name="pagination.js" target="head" />
<p:growl id="messages" autoUpdate="true" />
<f:metadata>
<f:viewParam name="topicId" value="#{topicBean.topic.id}" />
<f:event type="preRenderView" listener="#{topicBean.init(true)}" />
</f:metadata>
</ui:define>
</ui:composition>
....
If the metadata component the error message refers to is either f:viewParam
or f:event
, then I do have it/them enclosed by f:metadata
.
Any ideas about what I'm doing wrong? The error does not show if I set javax.faces.PROJECT_STAGE
to Production
, but I would like to keep it in Development
until I'm finished.
Edit1 - Versions:
Netbeans
: 7.3.1 (Build 201306052037)Java
: 1.7.0_25; Java HotSpot(TM) Client VM 23.25-b01Runtime
: Java(TM) SE Runtime Environment 1.7.0_25-b16Java EE
: Java EE 7 WebJSF implementation
: Mojarra 2.2.0Glassfish
: 4.0 build 89