<%@ taglib prefix="c"   uri="jakarta.tags.core" %>
<%@ taglib  prefix="fn" uri="jakarta.tags.functions" %>

<%@ attribute name="text" required="true" rtexprvalue="true" type="java.lang.String" %>
<%@ attribute name="textClass" required="true" rtexprvalue="true" type="java.lang.String" %>
<%@ attribute name="maxLength" required="true" rtexprvalue="true" type="java.lang.Integer" %>

<%@ tag body-content="empty" %>

<c:set var="textTrim"><c:choose><c:when test="${fn:length(text) > maxLength}">${fn:substring(text,0,maxLength)}...</c:when><c:otherwise>${text}</c:otherwise></c:choose></c:set>

<div class="${textClass}" title="${fn:escapeXml(text)}">${textTrim}</div>
