You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Fred R." <fr...@sourcetechcorp.com> on 2000/05/05 17:56:58 UTC
problem using custom tags
Hi,
I've developed a sample custom tag library and I'm trying to deploy it
on tomcat. But tomcat doesn't seem to be able to find the tld file. I
get the error :
Unable to open taglibrary
http://www.someurl.com/sampletags/sampletags-taglib : Parse Error in the
tag library descriptor: Element type "WEB-APP" is not declared.
Here is how I set things up:
web.xml for a sample app contains:
<WEB-APP>
<TAGLIB>
<TAGLIB-URI>http://www.someurl.com/sampletags/sampletags-taglib</TAGLIB-URI>
<TAGLIB-LOCATION>/WEB-INF/tlds/sampletags-taglib.tld</TAGLIB-LOCATION>
</TAGLIB>
.
.
.
<WEB-APP>
the jsp page has this directive:
<%@ taglib uri="http://www.someurl.com/sampletags/sampletags-taglib"
prefix="st" %>
this is the content of the sampletags-taglib.tld and this file is in
WEB-INF\tlds
<?xml version="1.0" encoding="ISO-8859-1" ?>
<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
<taglib>
<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname>st</shortname>
<info>A Sample Tag library</info>
<urn></urn>
<tag>
<name>ACustomTag</name>
<tagclass>sampletags.ACustomTag</tagclass>
<bodycontent>empty</bodycontent>
<info>A Tag to do something</info>
<attribute>
<name>displayFormat</name>
<required>false</required>
<rtexprvalue>false</rtexprvalue>
</attribute>
</tag>
</taglib>
TIA,
--
Fred R
Re: problem using custom tags
Posted by Dave Boyer <db...@ecal.com>.
I believe that the error message indicates that it does not recognize the
<WEB-APP> element....
I think capitalization matters...
If this is the actual code from your web-xml file, try making all tags in this
file lower-case.
I don't know for sure though, just a guess.
"Fred R." wrote:
> Hi,
>
> I've developed a sample custom tag library and I'm trying to deploy it
> on tomcat. But tomcat doesn't seem to be able to find the tld file. I
> get the error :
>
> Unable to open taglibrary
> http://www.someurl.com/sampletags/sampletags-taglib : Parse Error in the
> tag library descriptor: Element type "WEB-APP" is not declared.
>
> Here is how I set things up:
>
> web.xml for a sample app contains:
> <WEB-APP>
> <TAGLIB>
>
> <TAGLIB-URI>http://www.someurl.com/sampletags/sampletags-taglib</TAGLIB-URI>
>
> <TAGLIB-LOCATION>/WEB-INF/tlds/sampletags-taglib.tld</TAGLIB-LOCATION>
> </TAGLIB>
> .
> .
> .
> <WEB-APP>
>
> the jsp page has this directive:
> <%@ taglib uri="http://www.someurl.com/sampletags/sampletags-taglib"
> prefix="st" %>
>
> this is the content of the sampletags-taglib.tld and this file is in
> WEB-INF\tlds
> <?xml version="1.0" encoding="ISO-8859-1" ?>
> <!DOCTYPE taglib
> PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
> "http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">
>
> <taglib>
> <tlibversion>1.0</tlibversion>
> <jspversion>1.1</jspversion>
> <shortname>st</shortname>
> <info>A Sample Tag library</info>
> <urn></urn>
> <tag>
> <name>ACustomTag</name>
> <tagclass>sampletags.ACustomTag</tagclass>
> <bodycontent>empty</bodycontent>
> <info>A Tag to do something</info>
> <attribute>
> <name>displayFormat</name>
> <required>false</required>
> <rtexprvalue>false</rtexprvalue>
> </attribute>
> </tag>
> </taglib>
>
> TIA,
>
> --
> Fred R
>
> --------------------------------------------------------------------------
> To unsubscribe, email: tomcat-user-unsubscribe@jakarta.apache.org
> For additional commmands, email: tomcat-user-help@jakarta.apache.org