File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes How portable are Custom Tag Libraries? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "How portable are Custom Tag Libraries?" Watch "How portable are Custom Tag Libraries?" New topic
Author

How portable are Custom Tag Libraries?

Henrique Ordine
Ranch Hand

Joined: Sep 03, 2004
Posts: 127
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.


J2EE Architect/Developer
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60991
    
  65

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 ]

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60991
    
  65

Here is an example lifted from a JSP 2.0-compliant TLD:


[ April 11, 2007: Message edited by: Bear Bibeault ]
Henrique Ordine
Ranch Hand

Joined: Sep 03, 2004
Posts: 127
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

Joined: Dec 11, 2004
Posts: 13410

You have to look at that container's documentation.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How portable are Custom Tag Libraries?