0
Hello, I’m making a code with java and html and I need to make a list with Objects from Controller. I’m trying to use the tag <li>
but instead of forming a list he prints out the <li>
, being as follows:
this first <li>
that worked there, was that I put in the html itself, for testing... but I would need something to make the list for each item.
my java code:
if (tipos.size() > 0)
{
String vinculos = "";
for (Entidade entidade : tipos) {
vinculos += "<li>" + entidade.getNome() + ";</li>";
}
ModelAndView modelView = new ModelAndView("tipoadministracao/createedit", "model", model);
//return BusinessException.addInfo(modelView, attributes, model.getNome(), vinculos);
return BusinessException.ExceptionToViewInfo(modelView, model.getNome(), vinculos, "/tipoadministracao");
}else
{
service.delete(id, model);
ModelAndView modelView = new ModelAndView("redirect:/tipoadministracao");
return BusinessException.addSuccess(modelView, attributes, "Exclusão realizada com sucesso!");
}
HTML code:
<div class='row'>
<ul>
<li> [[${infoVinculos}]]</li>
</ul>
</div>
EDIT 1: I’ve already corrected a remark Sam made in one comment. I just used an if to check if there was already a link, anyway... the new result is like this:
One remark: if
[[${infoVinculos}]]
comes with<li>
, didn’t need to put another<li>
in HTML.– Sam
yes, thank you for the remark, but for while I’m just testing to see if it will read, after which I will correct these details.
– Samuel Machado
I couldn’t understand your doubt
– Leandro Angelo
So Leandro, if you look at the image, he writes the <li> tag, instead of transforming it into a list item, I would like each writing inside the tag to become an item in this list that I created
– Samuel Machado