Connecting Tech Pros Worldwide Forums | Help | Site Map

Attribute "field1" invalid for tag testtag according to TLD

yamini
Guest
 
Posts: n/a
#1: Jul 18 '05
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.

Eki Y. Baskoro
Guest
 
Posts: n/a
#2: Jul 18 '05

re: Attribute "field1" invalid for tag testtag according to TLD


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" <vadisa5@yahoo.com> wrote in message
news:aee8b0a.0406291532.763cfe39@posting.google.co m...[color=blue]
> 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[/color]
filled.[color=blue]
> If TLD is needed for tag files then what to fill for class name in .TLD[/color]
file?[color=blue]
>
> 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.[/color]


Closed Thread