This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring in Action (5th edition) and have Craig Walls on-line!
See this thread for details.
Win a copy of Spring in Action (5th edition) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Knute Snortum
  • Junilu Lacar
  • paul wheaton
Saloon Keepers:
  • Ganesh Patekar
  • Frits Walraven
  • Tim Moores
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Stephan van Hulst
  • salvin francis
  • Tim Holloway

taglib.tld giving problems help!  RSS feed

 
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using Jboss 3. Am writing a custom tag library. This is how my taglib.tld looks

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.2//EN"
"http://java.sun.com/dtd/web-jsptaglibrary_1_2.dtd" >

<taglib>

<tlibversion>1.0</tlibversion>
<jspversion>1.1</jspversion>
<shortname></shortname>
<tag>
<name>myTag</name>
<tagclass>tags.MyCustomTag</tagclass>
<bodycontent>empty</bodycontent>
<info>A Hello World tag</info>
</tag>
</taglib>

So when I put my war file in the jboss deploy directory, this is the server output I get -

11:51:53,859 INFO [MainDeployer] Starting deployment of package: file:/C:/jboss-3.0.3/server/default/deploy/t
ags.war
11:51:53,875 INFO [EmbeddedCatalinaServiceSX] deploy, ctxPath=/tags, warUrl=file:/C:/jboss-3.0.3/server/defau
lt/tmp/deploy/server/default/deploy/tags.war/87.tags.war
11:51:53,890 INFO [Engine] WebappLoader[/tags]: Deploying class repositories to work directory C:\jboss-3.0.3
\catalina\work\MainEngine\localhost\tags
11:51:53,890 INFO [Engine] WebappLoader[/tags]: Deploy class files /WEB-INF/classes to C:\jboss-3.0.3\catalin
a\work\MainEngine\localhost\tags\WEB-INF\classes
11:51:53,906 INFO [Engine] StandardManager[/tags]: Seeding random number generator class java.security.Secure
Random
11:51:53,906 INFO [Engine] StandardManager[/tags]: Seeding of random number generator has been completed
11:51:53,953 INFO [STDOUT] PARSE error at line 9 column -1
11:51:53,953 INFO [STDOUT] org.xml.sax.SAXParseException: Element "taglib" does not allow "tlibversion" here.

11:51:53,953 INFO [STDOUT] PARSE error at line 9 column -1
11:51:53,953 INFO [STDOUT] org.xml.sax.SAXParseException: Element "taglib" does not allow "tlibversion" here.

11:51:53,953 INFO [Engine] ContextConfig[/tags]: Added certificates -> request attribute Valve
11:51:54,031 INFO [EmbeddedCatalinaServiceSX] Using Java2 parent classloader delegation: true
11:51:54,031 INFO [Engine] StandardWrapper[/tags:default]: Loading container servlet default
11:51:54,031 INFO [Engine] StandardWrapper[/tags:invoker]: Loading container servlet invoker
11:51:54,046 INFO [MainDeployer] Deployed package: file:/C:/jboss-3.0.3/server/default/deploy/tags.war

So I try removing tlibversion and it says the tag jspversion is not allowed and so on..right down to <tag> not allowed. Please help!

Thanks
 
Nupur Gupta
Ranch Hand
Posts: 45
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can't believe it, I got the answer from the net.. the problem was with the <!DOCTYPE> tag... it should read

<!DOCTYPE taglib
PUBLIC "-//Sun Microsystems, Inc.//DTD JSP Tag Library 1.1//EN"
"http://java.sun.com/j2ee/dtds/web-jsptaglibrary_1_1.dtd">

and then it works.....
 
Marshal
Posts: 67163
169
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, that's assuming you want to use the JSP 1,1 version of the TLD format.

I don't know what version of Tomcat you are using with JBoss, but your TLD should match the version of JSP.

If you are getting validations errors, learn to read a DTD so you can find out what the valid XML is! As of JSP 2.0, the DTD has been replaced with an XML Schema, so you should learn how to interpret those as well.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!