我需要在 doStartTag 函数中获取请求者标签的名称我在 .tld 中有这个自定义标签
<tag>
<name>Resource</name>
<tag-class>Mirnint.Interface.Tag.MNIT_Resources</tag-class>
<body-content>JSP</body-content>
<attribute>
<name>Style</name>
<required>false</required>
</attribute>
<attribute>
<name>JavaScript</name>
<required>false</required>
</attribute>
</tag>
在 JSP 中:-
<%@ taglib uri="/webapp/Min" prefix="Min"%>
<html>
<head>
<Min:Resource/>
</head>
和java类是: -
@Override
public int doStartTag() throws JspException {
//Here i need to print the name of caller tag in this example it should be ("Resource")...
System.out.println(**The Name of Tag**);
}
你的输出应该是
Resource
感谢帮助...