Hmm, this should work, provided you're deploying correctly on a JSP 2.0 compliant servlet container, which Apache Tomcat 6.0.26 is.
Could you provide a little more info on the file structure of the web application and maybe the relevant bits of the web.xml?
My web.xml file contains mappings for filters, listeners and servlets. I have not indicated the mappings in this post as I have not used web.xml file for this particular page. I mean, I have placed my tag files in the 'tags' directory and have mentioned the directory path on the JSP as the value of the taglib's 'tagdir' attribute.
I also want to point out that my other tags where <jsp:attribute> is not used are working fine.
One of the errors that i faced was due to a comment that was written between the container tag and the jsp:attribute tag. It basically means that there should be no content (not even a comment) between <template:page> and the <jsp:attribute> tags
For example: Using the same example given above. If i add a comment.
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="template" tagdir="/WEB-INF/tags/mypagetemplates" %>
<!- some useless comment which will throw this subelement error ->
some html stuff
main html content
subject: Problem with <jsp:attribute> standard action