Elo bawię się trochę frontem i mam problem próbuje wyświetlić w tabelce za pomocą thymeleafa dane z listy obiektów(employee) wszystko jest ok tylko że mam w obiekcie parę list(np listę umiejętności i uwag) i chciałbym je też wyświetlić w jednej komórce. Oczywiście wyświetlają mi się te dane bo mam tostringi ale chciałbym to odpowiednio sformatować i ładnie wyświetlić nie za pomocą tostringa gdy próbuje tą liste wyświetlić w pętli w thymeleafie to wyskakuję mi błąd i nie wyświetla mi się strona. Czytam dokumentacje i na razie nie znalazłem odpowiedzi na mój problem nie rozumiem jak go rozwiązać czy ktoś mógł mnie trochę naprowadzić :
<tr>
<th>Lp</th>
<th>Imię i nazwisko</th>
<th>Stanowisko</th>
<th>Data zatrudnienia</th>
<th>Data zwolnienia</th>
<th>Umiejętności</th>
<th>Uwagi</th>
<th>Zdjęcie</th>
</tr>
<tr th:each="employees:${employees}">
<td th:text="${employeesStat.index+1}" ></td>
<td th:text="${employees.getLastName()}"></td>
<td th:text="${employees.getJobTitle()}">"</td>
<td th:text="${#calendars.format(employees.getDateOfEmployment(),'dd.MM.yyyy')}"></td>
<td th:text="${#calendars.format(employees.getDateOfTermination(),'dd.MM.yyyy')} ?: 'Wciąż pracuje'" />
<td th:each="${employees}">
<p th:text="${employees.getSkills}"></p>
</td>
<td th:text="${employees.getComments()}"></td>
<td th:text="${employees.getPhotoUrl()}"></td>
</tr>
public class Skill {
private String name;
private String level;
public Skill() {
}
public Skill(String name, String level) {
this.name = name;
this.level = level;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getLevel() {
return level;
}
public void setLevel(String level) {
this.level = level;
}
@Override
public String toString() {
final StringBuilder sb = new StringBuilder("");
sb.append("").append(name).append('\'');
sb.append("(").append(level).append('\'');
sb.append(')').append('\'');
System.out.println();
return sb.toString();
}
}
public class Employee {
private String firstName;
private String lastName;
private String photoUrl;
private Date dateOfEmployment;
private Date dateOfTermination;
private String jobTitle;
private double salary;
private List<Skill> skills = new ArrayList<>();
private List<String> comments = new ArrayList<>();