To write a plugin, you'll need to download the source for Tomcat. There are two steps:
This class, which implements org.apache.jasper.compiler.tagplugin.TagPlugin instructs Jasper what Java codes to generate in place of the tag handler calls. See Javadoc for org.apache.jasper.compiler.tagplugin.TagPlugin for details.
This file specifies the plugin classes and their corresponding tag handler classes.