Hello everyone I have an arraylist showing up as [MCA, MCB, COMM, DMISA] on the jsp.
Im calling it on the jsp:
<td>${bean.CodesNames}</td>
In the bean the getter is:
public void setCodesNames(ArrayList<String> CodesNames)
{
this.CodesNames = CodesNames;
}
How can I display this without the brackets?
You get the brackets because
ArrayList#toString()is implicitly called, in order to turn the list into a printable string. You can fix this by printing the list yourself in the JSP:or with a bean getter than returns a string:
(See the
JoinerJavaDocs if you’re not familiar with Guava.)