Hello,
is it possible to create a custom JSTL tag that accepts a non-string attribute?
I would like to create a tag that would be handle pagination using PagedListHolder from Spring MVC.
<%@tag body-content="scriptless" description="basic page template" pageEncoding="UTF-8"%>
<%-- The list of normal or fragment attributes can be specified here: --%>
<%@attribute name="pagedList" required="true" %>
<%-- any content can be specified here e.g.: --%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<c:choose>
<c:when test="${!pagedList.firstPage}">
<a href="
<c:url value="pagedList">
<c:param name="page" value="${pagedList.page - 1}"/>
</c:url>
"><<
</a>
</c:when>
<c:otherwise>
<<
</c:otherwise>
</c:choose>
<%-- ...more --%>
This tag would require an instance of PagedListHolder class.
Sort of like this, but I realize this is not valid.
<templ:pagedList pagedList="${players}"/>
Do I need to write a tag handler to achieve this?