Hi, I am trying to use the <
jsp:attribute> action in my program.
In my program I want to pass an attribute value from a JSP to a tag file.
My JSP is as follows:
The Fruit.jsp file
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="t" tagdir="/WEB-INF/tags" %>
<c:set var="f" value="apple" />
<t:MyTag>
<jsp:attribute name="fruit">
${f}
</jsp:attribute>
</t:MyTag>
The MyTag.tag file
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@attribute name="fruit" %>
<c:out value="${fruit}" />
<jsp:doBody />
I am using Apache
Tomcat 6.0.26 Server. When I type the url in the browser, I get the following error:
Fruit.jsp(7,9) jsp:attribute must be the subelement of a standard or custom action.
To the best of my knowledge, the MyTag tag is my custom action.
Can somebody assist me to identify what the problem is?
Regards,
John