I have a custom tag in a \".tag\" file that computes and outputs a value. Because I cannot post the code here, let\'s assume a simple example.
Content of file mytag.tag:
A little late, but better late than never. Maybe someone else will find this helpful
<%@ attribute name="var" required="true" type="java.lang.String" rtexprvalue="false"%>
<%@ attribute name="date" required="true" type="java.sql.Timestamp" description="The date to format"%>
<%@ variable alias="formattedDate" name-from-attribute="var" scope="AT_BEGIN" variable-class="java.lang.String"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
${fn:toLowerCase(time)}
Set your var attribute (it must be required and not allow an rtexprvalue), then set your variable alias, which is what you refer to the variable as in your custom tag.
Call your custom tag supplying the var variable