I have a List:
private List<Geracao> lista;
This list will be populated with data coming from a database:
lista = dao.findAll();
The findAll()
method:
@SuppressWarnings("unchecked")
@Override
public List<Geracao> findAll() throws Exception {
log.info("Encontrando todas as Gerações");
return em.createQuery("from Geracao").getResultList();
}
This data after being filled in lista
will go to the screen (JSF). I would like to do a formatting in the text before going to the screen, example: I have an attribute called nome
in class Geracao
. How can I do to get the value that will come from the bank, edit and then play to lista
?
My final goal is that in the text that will come from the bank before going to the screen, do a check if there is a word x. If there is x in the text, x will be formatted, example as bold before going to the screen. Ex:
texto = texto.replace(palavra, "<b>"+palavra+"</b>");