tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Aaron Loucks <lou...@cofront.net>
Subject Re: tld files inside jars are not auto discovered
Date Mon, 28 Nov 2005 03:47:37 GMT
The typo was in both the jsp and the tld, so it canceled itself out. The 
issue was with META-INF afterall. Even thought the extracted jar file 
had the META-INF folder in uppercase, the original (pre-jar) directory 
was not in uppercase. I'm guessing that the jar/zip format recoginizes 
the files: /META-INF/manifest.mf and /meta-inf/breadcrumbs_1_0.tld as 
being located in two different folders, but when extracted in windows, 
the files are both placed in the same folder and thus my method of 
checking the case of the folder was invalid. I changed my maven build so 
that the target path of the tld was META-INF rather than meta-inf and 
now it works.

Subir Sengupta wrote:

>You have a typo.
>
>uri="http://projects.cofront.net/tablibs/breadcrumbs" %>
>
>Should read:
>uri="http://projects.cofront.net/taglibs/breadcrumbs" %>
>
>Note: you typed tablibs instead of taglibs.
>
>Subir
>
>-----Original Message-----
>From: news [mailto:news@sea.gmane.org] On Behalf Of Bill Barker
>Sent: Saturday, November 26, 2005 10:15 PM
>To: users@tomcat.apache.org
>Subject: Re: tld files inside jars are not auto discovered
>
>You need to install your tld in /META-INF/.  Paths in jar files are 
>case-sensitive.
>
>"Aaron Loucks" <loucks@cofront.net> wrote in message 
>news:4387F654.4090200@cofront.net...
>  
>
>>I can't get TLD auto discovery to work for any custom taglibs i write
>>when I package them as jars. It works fine for the standard taglibs
>>(core, fmt, etc..). The tld file is packaged inside the jar as
>>'/meta-inf/breadcrumbs_1_0.tld', and breadcrumbs-1.0.jar is located in
>>/WEB-INF/lib. If i put a copy of the tld in the WEB-INF directory and
>>add a <taglib/> entry for it in web.xml, I'm able to use the tags. I
>>don't understand why Tomcat (5.0.28) is auto detecting the TLD files
>>inside the standard taglibs (standard.jar), but it won't autodetect
>>    
>>
>them
>  
>
>>in jar files i produce. Any help would be greatly appreciated.
>>
>>-Aaron
>>
>>test.jsp:
>>
>><%@ page language="java" contentType="text/html; charset=ISO-8859-1"
>>   pageEncoding="ISO-8859-1" %>
>>
>><%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
>><%@ taglib prefix="bc"
>>uri="http://projects.cofront.net/tablibs/breadcrumbs" %>
>>
>><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
>><html>
>><head>
>><meta http-equiv="Content-Type" content="text/html;
>>    
>>
>charset=ISO-8859-1">
>  
>
>><title>Breadcrumb Test</title>
>></head>
>><body>
>>   <bc:breadcrumbs separator=" &#187; " style="color:red;">
>>       <bc:breadcrumb href="page1.htm">page1</bc:breadcrumb>
>>       <bc:breadcrumb href="page2.htm">page2</bc:breadcrumb>
>>       <bc:breadcrumb href="page3.htm">page3</bc:breadcrumb>
>>   </bc:breadcrumbs>
>>
>></body>
>></html>
>>
>>Produces the following error:
>>
>>org.apache.jasper.JasperException: The absolute uri:
>>http://projects.cofront.net/tablibs/breadcrumbs         cannot be
>>resolved in either web.xml or the jar files deployed with this
>>    
>>
>application
>  
>
>>    
>>
>org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHand
>ler.java:50)
>  
>
>>    
>>
>org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java
>:411)
>  
>
>>    
>>
>org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java
>:118)
>  
>
>>    
>>
>org.apache.jasper.compiler.TagLibraryInfoImpl.generateTLDLocation(TagLib
>raryInfoImpl.java:316)
>  
>
>>    
>>
>org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.
>java:147)
>  
>
>org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
>  
>
>>   org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
>>   org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
>>   org.apache.jasper.compiler.Parser.parse(Parser.java:126)
>>
>>
>>    
>>
>org.apache.jasper.compiler.ParserController.doParse(ParserController.jav
>a:220)
>  
>
>>    
>>
>org.apache.jasper.compiler.ParserController.parse(ParserController.java:
>101)
>  
>
>>   org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
>>   org.apache.jasper.compiler.Compiler.compile(Compiler.java:470)
>>   org.apache.jasper.compiler.Compiler.compile(Compiler.java:451)
>>   org.apache.jasper.compiler.Compiler.compile(Compiler.java:439)
>>
>>
>>    
>>
>org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.ja
>va:511)
>  
>
>>    
>>
>org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.ja
>va:295)
>  
>
>>    
>>
>org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
>  
>
>>   org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
>>   javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
>>
>>*note* _The full stack trace of the root cause is available in the
>>Apache Tomcat/5.0.28 logs.
>>
>>
>>
>>_breadcrumbs_1_0.tld:
>>
>>
>><?xml version="1.0" encoding="UTF-8" ?>
>><taglib xmlns="http://java.sun.com/xml/ns/j2ee"
>>   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>>   xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>>http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd"
>>   version="2.0">
>>
>> <description>Breadcrumbs library</description>
>> <display-name>Breadcrumbs</display-name>
>> <tlib-version>1.1</tlib-version>
>> <short-name>bc</short-name>
>> <uri>http://projects.cofront.net/tablibs/breadcrumbs</uri>
>> <tag>
>>   <description>Creates Breadcrumbs.</description>
>>   <name>breadcrumbs</name>
>>
>>    
>>
><tag-class>net.cofront.taglibs.breadcrumbs.BreadCrumbsTag</tag-class>
>  
>
>>   <body-content>JSP</body-content>
>>   <attribute>
>>       <description>Separator string.</description>
>>       <name>separator</name>
>>       <required>yes</required>
>>       <rtexprvalue>true</rtexprvalue>
>>   </attribute>
>>   <attribute>
>>       <description>CSS style to be applied to all breadcrumb
>>links.</description>
>>       <name>style</name>
>>       <required>no</required>
>>       <rtexprvalue>true</rtexprvalue>
>>   </attribute>
>>   <attribute>
>>       <description>CSS style class to be applied to all breadcrumb
>>links.</description>
>>       <name>styleClass</name>
>>       <required>no</required>
>>       <rtexprvalue>true</rtexprvalue>
>>   </attribute>
>> </tag>
>> <tag>
>>   <description>A Breadcrumb.</description>
>>   <name>breadcrumb</name>
>>
>>    
>>
><tag-class>net.cofront.taglibs.breadcrumbs.BreadCrumbTag</tag-class>
>  
>
>>   <body-content>JSP</body-content>
>>   <attribute>
>>       <description>URL</description>
>>       <name>href</name>
>>       <required>true</required>
>>       <rtexprvalue>false</rtexprvalue>
>>   </attribute>
>> </tag>
>></taglib>
>>
>>
>>web.xml:
>>
>><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
>> xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
>>http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
>> version="2.4">
>>
>>   <display-name>ROOT</display-name>
>>
>>   <servlet>
>>       <servlet-name>action</servlet-name>
>>
>><servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
>>       <init-param>
>>           <param-name>config</param-name>
>>
>>    
>>
><param-value>/WEB-INF/config/struts-config.xml</param-value>
>  
>
>>       </init-param>
>>       <load-on-startup>1</load-on-startup>
>>   </servlet>
>>
>>   @maven.tomcat.generated@
>>
>>   <servlet-mapping>
>>       <servlet-name>action</servlet-name>
>>       <url-pattern>*.do</url-pattern>
>>   </servlet-mapping>
>>
>>   <jsp-config>
>>   <!--
>>       <taglib>
>>
>>
>>    
>>
><taglib-uri>http://projects.cofront.net/taglibs/breadcrumbs</taglib-uri>
>  
>
><taglib-location>/WEB-INF/breadcrumbs_1_0.tld</taglib-location>
>  
>
>>       </taglib>
>>   -->
>>   </jsp-config>
>>
>>   <welcome-file-list>
>>       <welcome-file>index.html</welcome-file>
>>       <welcome-file>index.htm</welcome-file>
>>       <welcome-file>index.jsp</welcome-file>
>>   </welcome-file-list>
>>
>></web-app>
>>
>>
>>    
>>
>
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
>For additional commands, e-mail: users-help@tomcat.apache.org
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Mime
View raw message