无法在自定义标记jsp中使用属性
我正在jsp中开发一个自定义标记处理程序,它接受一个名为“yourname”的属性。 .tld文件和标记处理程序文件包含相同的属性名(我也检查了这个案例)。但不知何故,当我运行web应用程序时,我遇到了一个例外。异常消息显示“根据TLD,属性yourname对于标记sayhello无效” 这是tld文件中的标记信息无法在自定义标记jsp中使用属性,jsp,jstl,custom-tag,Jsp,Jstl,Custom Tag,我正在jsp中开发一个自定义标记处理程序,它接受一个名为“yourname”的属性。 .tld文件和标记处理程序文件包含相同的属性名(我也检查了这个案例)。但不知何故,当我运行web应用程序时,我遇到了一个例外。异常消息显示“根据TLD,属性yourname对于标记sayhello无效” 这是tld文件中的标记信息 <tag> <name>sayhello</name> <tag-class>check.PrintTagHandler</ta
<tag>
<name>sayhello</name>
<tag-class>check.PrintTagHandler</tag-class>
<body-content>scriptless</body-content>
<attribute>yourname</attribute>
</tag>
这是电话
<hello:sayhello yourname="ABC"/>
标签声明:
<%@taglib prefix="hello" uri="/WEB-INF/tlds/newtag_library2"%>
一切似乎都是正确的,但我有个例外
请帮忙。对不起大家
tld应该是这样的
<attribute>
<name>yourname</name>
<required>true</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
你的名字
真的
假的
而不是
<attribute>yourname</attribute>
你的名字
yourname属性的getter setter是否已就位?@BhushanKawadkar:是的,它们已就位。当我不使用属性时,它工作正常。它正在打印欢迎空。问题是当我使用属性时。
<attribute>yourname</attribute>