Hello - I want to create a HTML table in the form. But the code I have doesnt work
if (identity != null) {
// Start building the HTML table
htmlTable.append("<table border='1' style='border-collapse: collapse; width: 100%;'>");
htmlTable.append("<tr><th>Account Name</th><th>SAMaccountName</th> <th>Account Description</th></tr>"); // Table headers
// Get the links (accounts) associated with this identity directly
List links = identity.getLinks();
// Iterate over each link to filter by application and active status
for (Link link : links) {
// Check for null and match application name
if (link.getApplication() != null && "AD12".equals(link.getApplication().getName()) || "AD7".equals(link.getApplication().getName() )) {
htmlTable.append("<tr>");
htmlTable.append("<td>").append(link.getDisplayName()).append("</td>"); // Account Name
htmlTable.append("<td>").append(link.getAttribute("sAMAccountName")).append("</td>"); // SAMaccountName
htmlTable.append("<td>").append(link.getAttribute("description")).append("</td>"); //Description
htmlTable.append("</tr>");
log.info("Found AD account: " + link.getDisplayName());
}
}
htmlTable.append("</table>");