2
I am working on a Java Web project, using the Spring MVC framework.
I’m having difficulty displaying information that comes from a list where analysts are registered.
The name of the analyst is correctly displayed, since the name is a String attribute of an object in the Analyst class. But when trying to display the CNPJ (String) of the Enterprise object (of the Enterprise class), which in this case is an attribute of an object of the Analyst class, the CNPJ number does not appear.
<c:forEach var="analista" items="${listAnalistas}" varStatus="status">
<a>Nome do analista: <c:out value="${analista.nome}" /> </a>
<a>CNPJ da empresa: <c:out value="${analista.empresa.cnpj}" /></a>
</c:forEach>
The list is filled in the Controller class:
@RequestMapping(value = "/")
public ModelAndView home() {
List<Analista> listAnalistas = analistaDao.list();
ModelAndView model = new ModelAndView("/home/home");
model.addObject("listAnalistas", listAnalistas);
return model;
}
Is there any way to display this information?