This might work:
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
<c:forEach items="${projectDataList}" var="projectDataList">
${fn:join(projectDataList.srNumbers.toArray(), ',')}
</c:forEach>
Which avoids a "hanging" comma, which your current code would produce. Not sure about the .toArray()
part as I haven't tested the code but an alternative could be to simply add another method to your ProjectData
class like:
import org.apache.commons.lang.StringUtils;
public class ProjectData {
public List <String> srNumbers;
public String comments;
public String getSrNumbersJoined() {
return StringUtils.join(srNumbers, ",");
}
}