Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jsp/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
无法在自定义标记jsp中使用属性_Jsp_Jstl_Custom Tag - Fatal编程技术网

无法在自定义标记jsp中使用属性

无法在自定义标记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

我正在jsp中开发一个自定义标记处理程序,它接受一个名为“yourname”的属性。 .tld文件和标记处理程序文件包含相同的属性名(我也检查了这个案例)。但不知何故,当我运行web应用程序时,我遇到了一个例外。异常消息显示“根据TLD,属性yourname对于标记sayhello无效”

这是tld文件中的标记信息

<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>