1
I’m working on a web application to develop a module, but I can’t display anything in the view, not even a simple message.
The view loads the template, but does not display anything I put in the view. The only thing that is being displayed is the title in the browser tab, through the tag <ui:define>
.
Follow the code below:
View
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:p="http://primefaces.org/ui"
xmlns:jsp="http://java.sun.com/JSP/Page"
template="template.xhtml">
<ui:define name="titulo">
Ver Livros de Ordem
</ui:define>
<h:outputText value="#{verLivrosOrdemController.msg}" />
</ui:composition>
Managed Bean
package br.org.aplicacao.servicosOnline.controller;
import java.io.Serializable;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
@ManagedBean
@ViewScoped
public class VerLivrosOrdemController implements Serializable {
String msg;
public String getMsg() {
return msg;
}
public void setMsg() {
this.msg = "Em breve!";
}
}
That’s exactly what it was. Thank you!
– user70765