• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How portable are Custom Tag Libraries?

 
Henrique Ordine
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi everyone,

I have written this web app with a custom tag and ran it on JBoss successfully. However, when I tried to deploy it to Sun One 7, I'd get an error, saying that it could not parse the tld file. After a lot of research, I deleted the hiphen (-) from the names of the tags in my TLD file. For example, body-content became bodycontent, tag-class became tagclass and so on. And that solved my deploying to Sun One 7 problem. However, at runtime, when I try to access a jsp that uses my tag library, I get the error:
XML parsing error on file /WEB-INF/siwcc-formato.tld: (line 6, col -1): Element "taglib" does not allow "tlibversion" here.'

But on JBoss it runs smoothly. Is that a bug on Sun One 7 or does each application server have its own spec of Tag Library Descriptors?
This is what my TLD file looks like:

<?xml version="1.0" encoding="UTF-8" ?>
<!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.2</jspversion>
<shortname>formato</shortname>
<uri>http://www.caixa.gov.br/siwcc/formato</uri>
<info>TagLibs bla bla</info>
<tag>
<name>auxTr</name>
<tagclass>br.gov.caixa.bsb.siwcc.web.tag.formato.AuxTrTag</tagclass>
<bodycontent>empty</bodycontent>
</tag>
</taglib>

p.s. Is there a Java/J2EE Application Migration forum?

Thanks in advance for any help.
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65122
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Henrique Ordine:
or does each application server have its own spec of Tag Library Descriptors?


No, there is just one format that is specified by the JSP Specification.

But, each version of JSP has made changes to that format. So it sounds like your two servers are running different versions of JSP.
[ April 11, 2007: Message edited by: Bear Bibeault ]
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 65122
91
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is an example lifted from a JSP 2.0-compliant TLD:


[ April 11, 2007: Message edited by: Bear Bibeault ]
 
Henrique Ordine
Ranch Hand
Posts: 129
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the response, Bear.
If it's not too much to ask, do you know how I can tell which version of JSP and EJB a container supports?
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You have to look at that container's documentation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic