I'm to trying to load an mysql text collumn to my jsp textarea by my servlet application, the problem is that my textarea are receiving the content of my bean used in my DAO List plus last record of my MySQL table.
This is my textarea tag:
This is my method to get the text of MySQL tabel:
And this is the content load in my jsp textarea:
Look, this is only one text write in my MySQL table to test, I have three records in my table and this is the last record in my table. But the two first records are don't load.
is telling the JSP to print out the contents of historico (using its toString()).
And historico comes from histConsulta, which comes from the output of getHistoryPaciente(), which is a List<DadosPaciente>.
So the toString is the one from the List, which cycles over the contents of the List (which are instances of DadosPaciente) and calls their toString methods.
I'm guessing that the toString for DadosPaciente produces a Stringthat contains all the attributes of DadosPaciente. Since only History_Paciente is populated, all the rest are null.
So, if you only need the one attribute then I would suggest just making that a List<String>, after all the method is called getHistoryPaciente and not getDadosPaciente.