By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,468 Members | 1,859 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,468 IT Pros & Developers. It's quick & easy.

Attribute "field1" invalid for tag testtag according to TLD

P: n/a
Here I am trying to use tag files in JSP2.0 with tomcat 5.
test.jsp
-------
%@ taglib prefix="test" tagdir="/WEB-INF/tags" %>
<html>
<head>
<title>Untitled Document</title>
</head>

<body>
initial values
<test:testtag/>
</body>
</html>

testtag.tag Tag file is
-----------

<p>bottom of message </p>
This is working fine.
But when I tried to pass attribute from jsp file as

<test:testtag field1="raja"/>
or

<test:testtag name="field1" value="raja"/>

then I am getting error message as
"Attribute "field1" invalid for tag testtag according to TLD".
Here I wonder why TLD is coming? even for tag files also TLD has to be filled.
If TLD is needed for tag files then what to fill for class name in .TLD file?

even I tried by keeping this below line in .tag file
<%@ attribute name="field1" required="false" %>

There was no use. Please can somebody clarify this.

Yamini.
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
G'Day,

JSP engine will try to locate file test.tld under /WEB-INF/tags directory.
This file basically defines the tag such as attributes and values accepted
correspondingly.
It is very likely that the tag that you are using does not have the
attribute you specified. Have a look at this file and confirm this.

Regards,

Eki
"yamini" <va*****@yahoo.com> wrote in message
news:ae*************************@posting.google.co m...
Here I am trying to use tag files in JSP2.0 with tomcat 5.
test.jsp
-------
<%@ taglib prefix="test" tagdir="/WEB-INF/tags" %>
<html>
<head>
<title>Untitled Document</title>
</head>

<body>
initial values
<test:testtag/>
</body>
</html>

testtag.tag Tag file is
-----------

<p>bottom of message </p>
This is working fine.
But when I tried to pass attribute from jsp file as

<test:testtag field1="raja"/>
or

<test:testtag name="field1" value="raja"/>

then I am getting error message as
"Attribute "field1" invalid for tag testtag according to TLD".
Here I wonder why TLD is coming? even for tag files also TLD has to be filled. If TLD is needed for tag files then what to fill for class name in .TLD file?
even I tried by keeping this below line in .tag file
<%@ attribute name="field1" required="false" %>

There was no use. Please can somebody clarify this.

Yamini.

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.