I'm working on a Java Web project, using the Spring MVC framework.
I'm having trouble displaying information that comes from a list where analysts are registered.
The analyst name is displayed correctly, since name is a String attribute of an Analyzer class object. But when trying to display the CNPJ (String) of the Enterprise object (of the Company class), which in this case is an attribute of an Analyzer class object, 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 populated 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?